goog.structs.StringSet |
opt_elements
: !Array=
Elements to add to the set. The non-string
items will be converted to strings, so 15 and '15' will mean the same.
|
Returns an iterator that iterates over the elements in the set.
NOTE: creating the iterator copies the whole set so use
#forEach when
possible.
Arguments:
Returns: !goog.iter.Iterator
An iterator over the elements in the set.
|
code » | |||
![]()
Adds a single element to the set.
Arguments:
|
code » | |||
![]()
Adds a the elements of an array to this set.
Arguments:
|
code » | |||
![]()
Adds the elements which are in
set1 but not in set2 to this
set.
Arguments:
|
code » | |||
![]()
Adds a the elements of a set to this set.
Arguments:
|
code » | |||
![]()
Removes all elements of the set.
|
code » | |||
No description.
Returns: !goog.structs.StringSet
Clone of the set.
|
code » | |||
Tells if the set contains the given element.
Arguments:
Returns: boolean
Whether it is in the set.
|
code » | |||
Tells if the set contains all elements of the array.
|
code » | |||
Tells if this set has the same elements as the given set.
Arguments:
Returns: boolean
Whether they have the same elements.
|
code » | |||
![]()
Calls a function for each element in the set.
Arguments:
|
code » | |||
Counts the number of elements in the set in linear time.
NOTE: getCount is always called at most once per set instance in google3.
If this usage pattern won't change, the linear getCount implementation is
better, because
Returns: number
The number of elements in the set.
|
code » | |||
Calculates the difference of two sets.
Arguments:
|
code » | |||
Calculates the intersection of this set with another set.
Arguments:
Returns: !goog.structs.StringSet
A new set with the common elements.
|
code » | |||
Calculates the symmetric difference of two sets.
Arguments:
|
code » | |||
Calculates the union of this set and another set.
Arguments:
Returns: !goog.structs.StringSet
A new set with the union of elements.
|
code » | |||
No description.
|
code » | |||
Tells if this set and the given set are disjoint.
Arguments:
Returns: boolean
True iff they don't have common elements.
|
code » | |||
No description.
Returns: boolean
Whether the set is empty.
|
code » | |||
Tells if this set is the subset of the given set.
Arguments:
Returns: boolean
Whether this set if the subset of that.
|
code » | |||
Tells if this set is the superset of the given set.
Arguments:
Returns: boolean
Whether this set if the superset of that.
|
code » | |||
Removes a single element from the set.
Arguments:
Returns: boolean
Whether the element was in the set.
|
code » | |||
![]()
Removes all elements of the given array from this set.
Arguments:
|
code » | |||
![]()
Removes all elements of the given set from this set.
Arguments:
|
code » |
![]()
An object storing the escaped elements of the set in its keys.
|
Code » |
Inverse function of
goog.structs.StringSet.encode_ .
NOTE: forEach would be 30% faster in FF if the compiler inlined decode.
|
code » | ||
![]()
The '__proto__' and the '__count__' keys aren't enumerable in Firefox, and
'toString', 'valueOf', 'constructor', etc. aren't enumerable in IE so they
have to be escaped before they are added to the internal object.
NOTE: When a new set is created, 50-80% of the CPU time is spent in encode.
Arguments:
Returns: *
The escaped element or the element itself if it doesn't have to
be escaped.
|
code » |
![]()
Empty object. Referring to it is faster than creating a new empty object in
goog.structs.StringSet.encode_ .
|
Code » |