LazySet<T> class

A lazy variable that caches a set with entries of type T.

  • An unmodifiable set view is returned to prevent modification of the cache.
  • The same object is returned until an update of the cache is requested by calling the method updateCache() or using the optional parameter updateCache: true to access the cached variable.
Inheritance

Constructors

LazySet(ObjectFactory<Set<T>> objectFactory)
Constructs an object of type LazySet<T>.

Properties

hashCode int
The hash code for this object.
no setterinherited
isUpToDate bool
Returns true if the cached object has been initialized and is up-to-date.
no setterinherited
objectFactory ObjectFactory<Set<T>>
Callback used to create the cached object.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call({bool updateCache = false}) Set<T>
Returns the cached object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
updateCache() → void
After calling this function the cached object will be (lazily) re-initialized when it is next accessed.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited