OSStringsSet class abstract final

A collection of OSString with every elements comply matching staregy when the first OSString inserted.

This set not only comply single object occurence of Set, but also mandated to unify String matching method except the first added OSString element.

final strs = OSStringsSet.of(<OSString>[
  OSString.allCapital("foo"), // Retained
  OSString.caseSensitive("FOO"), // Ignored
  OSString.allCapital("bar"), // Retained
  OSString.caseSensitive("baz") // Ignored
]);
Inheritance

Constructors

OSStringsSet()
Create empty set of OSString.
factory
OSStringsSet.fromStrings(Iterable<String> strs, [int flag = OSString.DEFAULT_MATCH])
Instantly create a OSStringsSet with String and preferred flag applied from OSString.matchingFlag.
factory
OSStringsSet.of(Iterable<OSString> elements)
Create a Set and then immediate addAll provided elements.
factory
OSStringsSet.unmodifiable(Iterable<OSString> elements)
Create an unmodifiable OSStringsSet.
factory

Properties

first OSString
The first element.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<OSString>
An iterator that iterates over the elements of this set.
no setterinherited
last OSString
The last element.
no setterinherited
length int
The number of elements in this Iterable.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single OSString
Checks that this iterable has only one element, and returns that element.
no setterinherited

Methods

add(OSString value) bool
Adds value to the set.
override
addAll(Iterable<OSString> elements) → void
Add multiple elements with identical matching method defined from the first element into OSStringsSet at once.
override
any(bool test(OSString element)) bool
Checks whether any element of this iterable satisfies test.
inherited
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(Object? element) bool
Whether value is in the set.
override
containsAll(Iterable<Object?> other) bool
Whether this set contains all the elements of other.
inherited
containsByString(String str) bool
Check does it contains preferred OSString in literial.
inherited
difference(Set<Object?> other) Set<OSString>
Creates a new set with the elements of this that are not in other.
inherited
elementAt(int index) OSString
Returns the indexth element.
inherited
every(bool f(OSString element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> f(OSString element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(OSString value), {OSString orElse()?}) OSString
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, OSString element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<OSString> other) Iterable<OSString>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void f(OSString element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
intersection(Set<Object?> other) Set<OSString>
Creates a new set which is the intersection between this set and other.
inherited
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(OSString value), {OSString orElse()?}) OSString
The last element that satisfies the given predicate test.
inherited
lookup(Object? element) OSString?
If an object equal to object is in the set, return it.
override
lookupByString(String str) OSString?
lookup an OSString that the given str is satsified the matching condition.
inherited
map<T>(T f(OSString element)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(OSString combine(OSString value, OSString element)) OSString
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
removeByString(String str) bool
Attempt to remove element by finding matched str in String.
inherited
removeWhere(bool test(OSString element)) → void
Removes all elements of this set that satisfy test.
inherited
retainAll(Iterable<Object?> elements) → void
Removes all elements of this set that are not elements in elements.
inherited
retainWhere(bool test(OSString element)) → void
Removes all elements of this set that fail to satisfy test.
inherited
singleWhere(bool test(OSString value), {OSString orElse()?}) OSString
The single element that satisfies test.
inherited
skip(int n) Iterable<OSString>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(OSString value)) Iterable<OSString>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int n) Iterable<OSString>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(OSString value)) Iterable<OSString>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<OSString>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<OSString>
Creates a Set with the same elements and behavior as this Set.
inherited
toString() String
A string representation of this object.
inherited
union(Set<OSString> other) Set<OSString>
Creates a new set which contains all the elements of this set and other.
inherited
where(bool f(OSString element)) Iterable<OSString>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
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