Import std.collections.set
std.collections.set
Set<T>: values without repeats, in the order they were added, which a Map holds as its keys.
std/collections/set.fb
Types
Set
class
@DebugElements Public Class Set<T: Hashable> Implements Iterable<T>, Cloneable, Defaultable, Hashable
A hash set: values, each held once, in the order they were added.
Examples
Local seen = Set<String>()
Expect(seen.Add("cave"))
Expect(!seen.Add("cave"))
Expect(seen.Contains("cave") && seen.Count == 1)std/collections/set.fb, line 17
-
A new, empty Set.
-
How many values it holds.
-
Adds the
value, and tells whether it's new. -
Removes the
value, and tells whether it was there. The others keep their order. -
Whether it holds
value. -
Takes every value out.
-
Adds each of the
valuesthat isn't there yet, in their order. -
Removes each of the
valuesthat's there. -
Removes each value that isn't among the
values. -
A new Set of this one's
values, then the other values that aren't among them. -
A new Set of this one's
valuesthat are among thevaluestoo. -
A new Set of this one's
valuesthat aren't among thevalues. -
A new Set of the
valuesthat are in this one or among thevalues, but not both: this one's first, then the others. -
Whether each of this one's
valuesis among thevalues. -
Whether each of the
valuesis in this one. -
Whether any of the
valuesis in this one. -
Whether the
values, without their repeats, are this one's, in any order. -
The values, in order, in a new array.
-
A new, empty Set.
-
A new Set with the same values, in the same order.
-
A new Set of the values that
keepsays to keep. -
The first value that
testsays is the one, or Null. -
Two Sets are equal when they have the same values, in any order.
-
A Set's hash, the same for equal Sets: its values', added up, so their order doesn't count.
-
The values, in the order they were added. Adding or removing one while going over them panics.
SetIterator
struct
Public Struct SetIterator<T: Hashable> Implements Iterator<T>
The values of a Set, in order, which For ... In goes over.
std/collections/set.fb, line 186
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Extends
Set
extend
Extend Set<T> Implements Printable
No doc comment.
std/collections/set.fb, line 198
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Report an issue with this page or with FutureBlitz on GitHub.