goog.structs.Set |
opt_values
: Array.<T> | Object.<?,T>>
Initial values to start with.
|
Returns an iterator that iterates over the elements in this set.
Arguments:
Returns: !goog.iter.Iterator
An iterator over the elements in this set.
|
code » | ||
![]()
Add a primitive or an object to the set.
Arguments:
|
code » | ||
![]()
Adds all the values in the given collection to this set.
Arguments:
|
code » | ||
![]()
Removes all elements from this set.
|
code » | ||
Creates a shallow clone of this set.
|
code » | ||
Tests whether this set contains the given element.
Arguments:
Returns: boolean
True if this set contains the given element.
|
code » | ||
Tests whether this set contains all the values in a given collection.
Repeated elements in the collection are ignored, e.g. (new
goog.structs.Set([1, 2])).containsAll([1, 1]) is True.
Arguments:
Returns: boolean
True if the set contains all elements.
|
code » | ||
Finds all values that are present in this set and not in the given
collection.
Arguments:
Returns: !goog.structs.Set
A new set containing all the values
(primitives or objects) present in this set but not in the given
collection.
|
code » | ||
Tests whether the given collection consists of the same elements as this set,
regardless of order, without repetition. Primitives are treated as equal if
they have the same type and convert to the same string; objects are treated
as equal if they are references to the same object. This operation is O(n).
Arguments:
Returns: boolean
True if the given collection consists of the same elements
as this set, regardless of order, without repetition.
|
code » | ||
No description.
Returns: number
The number of elements in the set.
|
code » | ||
Returns an array containing all the elements in this set.
|
code » | ||
Finds all values that are present in both this set and the given collection.
Returns: !goog.structs.Set.<T | S>
A new set containing all the values
(primitives or objects) present in both this set and the given
collection.
|
code » | ||
Tests whether this set is empty.
Returns: boolean
True if there are no elements in this set.
|
code » | ||
Tests whether the given collection contains all the elements in this set.
Primitives are treated as equal if they have the same type and convert to the
same string; objects are treated as equal if they are references to the same
object. This operation is O(n).
Arguments:
Returns: boolean
True if this set is a subset of the given collection.
|
code » | ||
Removes the given element from this set.
Arguments:
Returns: boolean
Whether the element was found and removed.
|
code » | ||
![]()
Removes all values in the given collection from this set.
Arguments:
|
code » |
No description.
|
Code » |
Obtains a unique key for an element of the set. Primitives will yield the
same key if they have the same type and convert to the same string. Object
references will yield the same key only if they refer to the same object.
Arguments:
Returns: string
A unique key for this value/object.
|
code » |