public class TLcdIdentityHashSet<T> extends AbstractSet<T> implements ILcdCloneable
Collections.newSetFromMap(new IdentityHashMap<>());
,
but has some clone optimizations.Constructor and Description |
---|
TLcdIdentityHashSet() |
TLcdIdentityHashSet(Collection<? extends T> aCollection) |
TLcdIdentityHashSet(int aInitialCapacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
TLcdIdentityHashSet<T> |
clone()
Makes
Object.clone() public. |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
toString
finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public TLcdIdentityHashSet()
public TLcdIdentityHashSet(int aInitialCapacity)
public TLcdIdentityHashSet(Collection<? extends T> aCollection)
public boolean contains(Object o)
contains
in interface Collection<T>
contains
in interface Set<T>
contains
in class AbstractCollection<T>
public Object[] toArray()
toArray
in interface Collection<T>
toArray
in interface Set<T>
toArray
in class AbstractCollection<T>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<T>
toArray
in interface Set<T>
toArray
in class AbstractCollection<T>
public boolean add(T e)
add
in interface Collection<T>
add
in interface Set<T>
add
in class AbstractCollection<T>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
containsAll
in class AbstractCollection<T>
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T>
addAll
in interface Set<T>
addAll
in class AbstractCollection<T>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T>
retainAll
in interface Set<T>
retainAll
in class AbstractCollection<T>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T>
removeAll
in interface Set<T>
removeAll
in class AbstractSet<T>
public int size()
size
in interface Collection<T>
size
in interface Set<T>
size
in class AbstractCollection<T>
public boolean isEmpty()
isEmpty
in interface Collection<T>
isEmpty
in interface Set<T>
isEmpty
in class AbstractCollection<T>
public boolean remove(Object o)
remove
in interface Collection<T>
remove
in interface Set<T>
remove
in class AbstractCollection<T>
public void clear()
clear
in interface Collection<T>
clear
in interface Set<T>
clear
in class AbstractCollection<T>
public boolean equals(Object o)
equals
in interface Collection<T>
equals
in interface Set<T>
equals
in class AbstractSet<T>
public int hashCode()
hashCode
in interface Collection<T>
hashCode
in interface Set<T>
hashCode
in class AbstractSet<T>
public TLcdIdentityHashSet<T> clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()