public class SynchronizedCompactHashSet<E> extends CompactHashSet<E>
deletedObject, elements, freecells, INITIAL_SIZE, LOAD_FACTOR, modCount, nullObject, objects
Constructor and Description |
---|
SynchronizedCompactHashSet() |
SynchronizedCompactHashSet(Collection c) |
SynchronizedCompactHashSet(int size) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object o)
Adds the specified element to this set if it is not already
present.
|
boolean |
addAll(Collection coll) |
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(Object o)
Returns true if this set contains the specified element.
|
boolean |
containsAll(Collection coll) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty()
Returns true if this set contains no elements.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(Object o)
Removes the specified element from the set.
|
boolean |
removeAll(Collection coll) |
boolean |
retainAll(Collection coll) |
int |
size()
Returns the number of elements in this set (its cardinality).
|
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
String |
toString() |
dump, rehash, rehash
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public SynchronizedCompactHashSet()
public SynchronizedCompactHashSet(Collection c)
public SynchronizedCompactHashSet(int size)
public int size()
CompactHashSet
size
in interface Collection<E>
size
in interface Set<E>
size
in class CompactHashSet<E>
public boolean isEmpty()
CompactHashSet
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class CompactHashSet<E>
public boolean contains(Object o)
CompactHashSet
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class CompactHashSet<E>
o
- element whose presence in this set is to be tested.public Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class CompactHashSet<E>
public <E> E[] toArray(E[] a)
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class CompactHashSet<E>
public Iterator<E> iterator()
CompactHashSet
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface Set<E>
iterator
in class CompactHashSet<E>
ConcurrentModificationException
public boolean add(Object o)
CompactHashSet
add
in interface Collection<E>
add
in interface Set<E>
add
in class CompactHashSet<E>
o
- element to be added to this set.public boolean remove(Object o)
CompactHashSet
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class CompactHashSet<E>
public boolean containsAll(Collection coll)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
containsAll
in class AbstractCollection<E>
public boolean addAll(Collection coll)
addAll
in interface Collection<E>
addAll
in interface Set<E>
addAll
in class AbstractCollection<E>
public boolean removeAll(Collection coll)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public boolean retainAll(Collection coll)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>
public void clear()
CompactHashSet
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class CompactHashSet<E>
public String toString()
toString
in class AbstractCollection<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface Set<E>
equals
in class AbstractSet<E>
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface Set<E>
hashCode
in class AbstractSet<E>