ModifiableSetFromISet<T> class

The ModifiableSetFromISet is a safe, modifiable Set that is built from an ISet. The construction of the set is fast at first, since it makes no copies of the ISet items, but just uses it directly.

If and only if you use a method that mutates the set, like add, it will unlock internally (make a copy of all ISet items). This is transparent to you, and will happen at most only once. In other words, it will unlock the ISet, lazily, only if necessary.

If you never mutate the set, it will be very fast to lock this set back into an ISet.

See also: UnmodifiableSetFromISet

Implemented types
Mixed-in types
Available extensions

Constructors

ModifiableSetFromISet.new(ISet<T>? iset)

Properties

asComparableEntries Iterable<Entry<K, V>>

Available on Iterable<MapEntry<K, V>>, provided by the FicIterableOfMapEntryExtension extension

MapEntry is not Comparable. If you need to compare two iterables of MapEntry you can do this:
no setter
first → T
The first element.
no setterinherited
firstOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The first element of this iterator, or null if the iterable is empty.
no setter
hashCode int
The hash code for this object.
no setterinherited
indexed Iterable<(int, T)>

Available on Iterable<T>, provided by the IterableExtensions extension

Pairs of elements of the indices and elements of this iterable.
no setter
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<T>
An iterator that iterates over the elements of this set.
no setteroverride
last → T
The last element.
no setterinherited
lastOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The last element of this iterable, or null if the iterable is empty.
no setter
length int
The number of elements in this Iterable.
no setteroverride
lock ISet<T?>
no setter
lock ISet<T>

Available on Set<T>, provided by the FicSetExtension extension

Locks the set, returning an immutable set (ISet).
no setter
lockUnsafe ISet<T>

Available on Set<T>, provided by the FicSetExtension extension

Locks the set, returning an immutable set (ISet).
no setter
nonNulls Iterable<T>

Available on Iterable<T?>, provided by the NullableIterableExtensions extension

The non-null elements of this iterable.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single → T
Checks that this iterable has only one element, and returns that element.
no setterinherited
singleOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The single element of this iterator, or null.
no setter
wait Future<List<T>>

Available on Iterable<Future<T>>, provided by the FutureIterable extension

Waits for futures in parallel.
no setter

Methods

add(T value) bool
Adds value to the set.
override
addAll(Iterable<T> elements) → void
Adds all elements to this set.
inherited
any(bool test(T element)) bool
Checks whether any element of this iterable satisfies test.
inherited
anyIs(T value) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns true if any item is equal to value.
asList() List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a List containing the elements of this iterable. If the Iterable is already a List, return the same instance (nothing new is created). Otherwise, create a new List from it. See also: Dart's native toList, which always creates a new list.
asNameMap() Map<String, T>

Available on Iterable<T>, provided by the EnumByName extension

Creates a map from the names of enum values to the values.
asSet() Set<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates a Set containing the same elements as this iterable. If the Iterable is already a Set, return the same instance (nothing new is created). Otherwise, create a new Set from it. See also: Dart's native toSet, which always creates a new set.
averageBy<N extends num>(N mapper(T element)) double

Available on Iterable<T>, provided by the FicIterableExtension extension

The arithmetic mean of the elements of a non-empty iterable. The arithmetic mean is the sum of the elements divided by the number of elements. If iterable is empty it returns 0. Examples:
byName(String name) → T

Available on Iterable<T>, provided by the EnumByName extension

Finds the enum value in this list with name name.
cast<R>() Set<R>
Provides a view of this set as a set of R instances.
inherited
clear() → void
Removes all elements from the set.
inherited
contains(covariant T? element) bool
Whether value is in the set.
override
containsAll(Iterable<Object?> other) bool
Whether this set contains all the elements of other.
inherited
deepEquals(Iterable? other, {bool ignoreOrder = false}) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Compare all items, in order or not, according to ignoreOrder, using operator ==. Return true if they are all the same, in the same order.
deepEqualsByIdentity(Iterable? other, {bool ignoreOrder = false}) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if they are all the same, in the same order. Compare all items, in order or not, according to ignoreOrder, using identical. Return true if they are all the same, in the same order.
diffAndIntersect<G>(Set<G> other, {bool diffThisMinusOther = true, bool diffOtherMinusThis = true, bool intersectThisWithOther = true, bool intersectOtherWithThis = true}) DiffAndIntersectResult<T, G>

Available on Set<T>, provided by the FicSetExtension extension

Given this set and other, returns:
difference(Set<Object?> other) Set<T>
Creates a new set with the elements of this that are not in other.
inherited
elementAt(int index) → T
Returns the indexth element.
inherited
elementAtOrNull(int index) → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The element at position index of this iterable, or null.
every(bool f(T element)) bool
Checks whether every element of this iterable satisfies test.
inherited
everyIs(T value) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns true if all items are equal to value.
expand<T>(Iterable<T> f(T element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
findDuplicates() Set<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Finds duplicates and then returns a Set with the duplicated elements. If there are no duplicates, an empty Set is returned.
firstWhere(bool test(T value), {T orElse()?}) → T
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, T element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<T> other) Iterable<T>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void f(T element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
intersection(Set<Object?> other) Set<T>
Creates a new set which is the intersection between this set and other.
inherited
isFirst(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is the same (by identity) as the first iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you have the first item. For example:
isLast(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is the same (by identity) as the last iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you have the last item. For example:
isNotFirst(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is NOT the same (by identity) as the first iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you don't have the first item. For example:
isNotLast(T item) bool

Available on Iterable<T>, provided by the FicIterableExtension extension

Return true if the given item is NOT the same (by identity) as the last iterable item. If this iterable is empty, always return null. This is useful for non-indexed loops where you need to know when you don't have the last item. For example:
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(T value), {T orElse()?}) → T
The last element that satisfies the given predicate test.
inherited
lookup(covariant T element) → T?
If an object equal to object is in the set, return it.
override
map<T>(T f(T element)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
mapIndexedAndLast<R>(R convert(int index, T item, bool isLast)) Iterable<R>

Available on Iterable<T>, provided by the FicIterableExtension extension

Maps each element and its index to a new value. This is similar to mapIndexed but also tells you which item is the last.
mapNotNull<E>(E? f(T? e)) Iterable<E>

Available on Iterable<T?>, provided by the FicIterableExtensionTypeNullable extension

Similar to map, but MAY return a non-nullable type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(T combine(T value, T element)) → T
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
remove(Object? value) bool
Removes value from the set.
override
removeAll(Iterable<Object?> elements) → void
Removes each element of elements from this set.
inherited
removeNulls() → void

Available on Set<T>, provided by the FicSetExtension extension

Removes all nulls from the Set.
removeWhere(bool test(T element)) → void
Removes all elements of this set that satisfy test.
inherited
restrict(T? item, {required T orElse}) → T

Available on Iterable<T>, provided by the FicIterableExtension extension

Restricts some item to one of those present in this iterable.
retainAll(Iterable<Object?> elements) → void
Removes all elements of this set that are not elements in elements.
inherited
retainWhere(bool test(T element)) → void
Removes all elements of this set that fail to satisfy test.
inherited
singleWhere(bool test(T value), {T orElse()?}) → T
The single element that satisfies test.
inherited
skip(int n) Iterable<T>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(T value)) Iterable<T>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
sortedLike(Iterable ordering) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a list, sorted according to the order specified by the ordering iterable. Items which don't appear in ordering will be included in the end, in their original order. Items of ordering which are not found in the original list are ignored.
sortedReversed([Comparator<T>? compare]) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates a reversed sorted list of the elements of the iterable.
sumBy<N extends num>(N mapper(T element)) → N

Available on Iterable<T>, provided by the FicIterableExtension extension

The sum of the values returned by the mapper function.
take(int n) Iterable<T>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(T value)) Iterable<T>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toggle(T item) bool

Available on Set<T>, provided by the FicSetExtension extension

If the item doesn't exist in the set, add it and return true. Otherwise, if the item already exists in the set, remove it and return false.
toIList([ConfigList? config]) IList<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates an immutable list (IList) from the iterable.
toISet([ConfigSet? config]) ISet<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Creates an immutable set (ISet) from the iterable.
toList({bool growable = true}) List<T>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<T>
Creates a Set with the same elements and behavior as this Set.
override
toString() String
A string representation of this object.
inherited
union(Set<T> other) Set<T>
Creates a new set which contains all the elements of this set and other.
inherited
unzip() Tuple2<Iterable<U>, Iterable<V>>

Available on Iterable<Tuple2<U, V>>, provided by the FICZipExtension extension

Iterable Tuple2 as Iterable
updateById(Iterable<T> newItems, dynamic id(T item)) List<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Returns a new list where newItems are added or updated, by their id (and the id is a function of the item), like so:
where(bool f(T element)) Iterable<T>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereNoDuplicates({dynamic by(T item)?, bool removeNulls = false}) Iterable<T>

Available on Iterable<T>, provided by the FicIterableExtension extension

Removes all duplicates, leaving only the distinct items. Optionally, you can provide an by function to compare the items.
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

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