Class IdentitySet
java.lang.Object
org.castor.core.util.IdentitySet
- All Implemented Interfaces:
Iterable,Collection,Set
An IdentitySet that uses reference-equality instead of object-equality. According
to its special function it violates some design contracts of the
Set
interface.- Since:
- 0.9.9
- Version:
- $Revision: 7491 $ $Date: 2006-04-13 10:49:49 -0600 (Thu, 13 Apr 2006) $
- Author:
- Ralf Joachim
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a set with default capacity.IdentitySet(int capacity) Construct a set with given capacity. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection c) This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.voidclear()booleanbooleanIn contrast with the design contract of theSetinterface this method has not been implemented and throws aUnsupportedOperationException.booleanisEmpty()iterator()booleanbooleanThis optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.booleanThis optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.intsize()Object[]toArray()Object[]Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
IdentitySet
public IdentitySet()Construct a set with default capacity. -
IdentitySet
public IdentitySet(int capacity) Construct a set with given capacity.- Parameters:
capacity- The capacity of entries this set should be initialized with.
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceSet- See Also:
-
size
public int size()- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceSet- See Also:
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceSet- See Also:
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceSet- See Also:
-
contains
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceSet- See Also:
-
remove
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceSet- See Also:
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceSet- See Also:
-
toArray
-
containsAll
In contrast with the design contract of theSetinterface this method has not been implemented and throws aUnsupportedOperationException.- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceSet- See Also:
-
addAll
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceSet- See Also:
-
removeAll
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceSet- See Also:
-
retainAll
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceSet- See Also:
-