HashSet

This class implements the {@code Set} interface, backed by a hash table (actually a {@code HashMap} instance). It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time. This class permits the {@code null} element.

Constructors

this
this()

Constructs a new, empty set.

this
this(Collection c)

Constructs a new set containing the elements in the specified collection.

this
this(int initialCapacity)

Constructs a new, empty set.

this
this(int initialCapacity, float loadFactor)

Constructs a new, empty set.

Members

Aliases

SetType
alias SetType = tango.util.container.HashSet.HashSet!(Object)
Undocumented in source.
SetType
alias SetType = void[0][Object]
Undocumented in source.

Classes

LocalIterator
class LocalIterator
Undocumented in source.

Functions

add
bool add(Object o)
bool add(String o)

Adds the specified element to this set if it is not already present. More formally, adds the specified element {@code e} to this set if this set contains no element {@code e2} such that {@code Objects.equals(e, e2)}. If this set already contains the element, the call leaves the set unchanged and returns {@code false}.

addAll
bool addAll(Collection c)

Adds all of the elements in the specified collection to this set if they're not already present (optional operation). If the specified collection is also a set, the {@code addAll} operation effectively modifies this set so that its value is the <i>union</i> of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.

clear
void clear()

Removes all of the elements from this set. The set will be empty after this call returns.

contains
bool contains(Object o)
bool contains(String o)

Returns {@code true} if this set contains the specified element. More formally, returns {@code true} if and only if this set contains an element {@code e} such that {@code Objects.equals(o, e)}.

containsAll
bool containsAll(Collection c)
Undocumented in source. Be warned that the author may not have intended to support it.
isEmpty
bool isEmpty()

Returns {@code true} if this set contains no elements.

iterator
Iterator iterator()
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(ref Object value) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
equals_t opEquals(Object o)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
bool remove(Object o)
bool remove(String o)

Removes the specified element from this set if it is present. More formally, removes an element {@code e} such that {@code Objects.equals(o, e)}, if this set contains such an element. Returns {@code true} if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)

removeAll
bool removeAll(Collection c)
Undocumented in source. Be warned that the author may not have intended to support it.
retainAll
bool retainAll(Collection c)
Undocumented in source. Be warned that the author may not have intended to support it.
size
int size()

Returns the number of elements in this set (its cardinality).

toArray
Object[] toArray(Object[] a)
Undocumented in source. Be warned that the author may not have intended to support it.
toArray
Object[] toArray()

Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.

toHash
hash_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
String toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Set

add
bool add(Object o)
Undocumented in source.
add
bool add(String o)
Undocumented in source.
addAll
bool addAll(Collection c)
Undocumented in source.
clear
void clear()
Undocumented in source.
contains
bool contains(Object o)
Undocumented in source.
contains
bool contains(String o)
Undocumented in source.
containsAll
bool containsAll(Collection c)
Undocumented in source.
opEquals
equals_t opEquals(Object o)
Undocumented in source.
toHash
hash_t toHash()
Undocumented in source.
isEmpty
bool isEmpty()
Undocumented in source.
iterator
Iterator iterator()
Undocumented in source.
remove
bool remove(Object o)
Undocumented in source.
remove
bool remove(String o)
Undocumented in source.
removeAll
bool removeAll(Collection c)
Undocumented in source.
retainAll
bool retainAll(Collection c)
Undocumented in source.
size
int size()
Undocumented in source.
toArray
Object[] toArray()
Undocumented in source.
toArray
Object[] toArray(Object[] a)
Undocumented in source.
toString
String toString()
Undocumented in source.
opApply
int opApply(int delegate(ref Object value) dg)
Undocumented in source.

Meta