Package com.luciad.util.collections
Class TLcdIdentityHashSet<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractSet<T>
com.luciad.util.collections.TLcdIdentityHashSet<T>
- All Implemented Interfaces:
ILcdCloneable
,Cloneable
,Iterable<T>
,Collection<T>
,Set<T>
A hash set that uses identity comparisons for its values.
It is functionally equivalent to
Collections.newSetFromMap(new IdentityHashMap<>());
,
but has some clone optimizations.- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionTLcdIdentityHashSet
(int aInitialCapacity) TLcdIdentityHashSet
(Collection<? extends T> aCollection) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
clone()
MakesObject.clone()
public.boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.util.AbstractCollection
toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
TLcdIdentityHashSet
public TLcdIdentityHashSet() -
TLcdIdentityHashSet
public TLcdIdentityHashSet(int aInitialCapacity) -
TLcdIdentityHashSet
-
-
Method Details
-
contains
- Specified by:
contains
in interfaceCollection<T>
- Specified by:
contains
in interfaceSet<T>
- Overrides:
contains
in classAbstractCollection<T>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
add
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceSet<T>
- Overrides:
add
in classAbstractCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
- Overrides:
containsAll
in classAbstractCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
- Specified by:
addAll
in interfaceSet<T>
- Overrides:
addAll
in classAbstractCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceSet<T>
- Overrides:
retainAll
in classAbstractCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
- Specified by:
removeAll
in interfaceSet<T>
- Overrides:
removeAll
in classAbstractSet<T>
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceSet<T>
- Specified by:
size
in classAbstractCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
- Specified by:
isEmpty
in interfaceSet<T>
- Overrides:
isEmpty
in classAbstractCollection<T>
-
remove
- Specified by:
remove
in interfaceCollection<T>
- Specified by:
remove
in interfaceSet<T>
- Overrides:
remove
in classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceSet<T>
- Overrides:
clear
in classAbstractCollection<T>
-
equals
- Specified by:
equals
in interfaceCollection<T>
- Specified by:
equals
in interfaceSet<T>
- Overrides:
equals
in classAbstractSet<T>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<T>
- Specified by:
hashCode
in interfaceSet<T>
- Overrides:
hashCode
in classAbstractSet<T>
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.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 ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-