Package org.proxy4j.core.struct
Class IdentityHashSet<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<T>
-
- org.proxy4j.core.struct.IdentityHashSet<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Set<T>
public class IdentityHashSet<T> extends AbstractSet<T> implements Set<T>
A
Setimplementation based on reference (not object) equality. This is an intentional violation of theSet.equals(Object)contract for specialized purposes. Uses a backing instance ofIdentityHashMap.- Author:
- Brennan Spies
-
-
Constructor Summary
Constructors Constructor Description IdentityHashSet()IdentityHashSet(int expectedMaxSize)IdentityHashSet(Collection<? extends T> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T o)voidclear()booleanisEmpty()Iterator<T>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)intsize()-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, 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
addAll, contains, containsAll, equals, hashCode, retainAll, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
IdentityHashSet
public IdentityHashSet()
-
IdentityHashSet
public IdentityHashSet(int expectedMaxSize)
-
IdentityHashSet
public IdentityHashSet(Collection<? extends T> c)
-
-
Method Detail
-
add
public boolean add(T o)
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Overrides:
addin classAbstractCollection<T>- See Also:
Set.add(Object)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Overrides:
clearin classAbstractCollection<T>- See Also:
Set.clear()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceSet<T>- Overrides:
isEmptyin classAbstractCollection<T>- See Also:
Set.isEmpty()
-
iterator
public Iterator<T> iterator()
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin interfaceSet<T>- Specified by:
iteratorin classAbstractCollection<T>- See Also:
Set.iterator()
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractCollection<T>- See Also:
Set.remove(Object)
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceSet<T>- Overrides:
removeAllin classAbstractSet<T>- See Also:
Set.removeAll(java.util.Collection)
-
size
public int size()
- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein classAbstractCollection<T>- See Also:
Set.size()
-
-