public class UniqueSet<E> extends CompactHashSet<E>
| Modifier and Type | Field and Description |
|---|---|
protected int |
hc |
protected int |
hc_modCount |
deletedObject, elements, freecells, INITIAL_SIZE, LOAD_FACTOR, modCount, nullObject, objects| Constructor and Description |
|---|
UniqueSet() |
UniqueSet(Collection<E> c) |
UniqueSet(int size) |
UniqueSet(UniqueSet<E> s) |
UniqueSet(UniqueSet<E> s1,
UniqueSet<E> s2) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o)
Adds the specified element to this set if it is not already
present.
|
UniqueSet<E> |
add(UniqueSet<E> set,
Object o,
boolean dereference) |
boolean |
addAll(Collection<? extends E> coll) |
void |
clear()
Removes all of the elements from this set.
|
void |
dereference(UniqueSet<E> set) |
void |
dump()
INTERNAL: Used for debugging only.
|
protected boolean |
equalsAdd(UniqueSet<E> other,
Object o) |
protected boolean |
equalsRemove(UniqueSet<E> other,
Object o) |
UniqueSet<E> |
get(Set<E> set)
INTERNAL: Get the internal representation of a given set.
|
int |
getReferenceCount() |
int |
hashCode() |
protected E |
lookup(Object o)
INTERNAL: Looks up the object in the hashset and returns the
actual object stored at the hashset.
|
boolean |
remove(Object o)
Removes the specified element from the set.
|
UniqueSet<E> |
remove(UniqueSet<E> set,
Object o,
boolean dereference) |
boolean |
removeAll(Collection<?> coll) |
boolean |
retainAll(Collection<?> coll) |
String |
toString() |
contains, isEmpty, iterator, rehash, rehash, size, toArray, toArrayequalscontainsAllclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, spliteratorparallelStream, removeIf, streampublic UniqueSet()
public UniqueSet(int size)
public UniqueSet(Collection<E> c)
public int getReferenceCount()
public UniqueSet<E> get(Set<E> set)
protected E lookup(Object o)
public void dump()
CompactHashSetdump in class CompactHashSet<E>public boolean add(Object o)
CompactHashSetadd 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)
CompactHashSetremove in interface Collection<E>remove in interface Set<E>remove in class CompactHashSet<E>public boolean addAll(Collection<? extends E> 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()
CompactHashSetclear in interface Collection<E>clear in interface Set<E>clear in class CompactHashSet<E>public String toString()
toString in class AbstractCollection<E>public int hashCode()
hashCode in interface Collection<E>hashCode in interface Set<E>hashCode in class AbstractSet<E>