Package org.castor.core.util
Class IdentitySet
- java.lang.Object
-
- org.castor.core.util.IdentitySet
-
- All Implemented Interfaces:
java.lang.Iterable,java.util.Collection,java.util.Set
public final class IdentitySet extends java.lang.Object implements java.util.SetAn IdentitySet that uses reference-equality instead of object-equality. According to its special function it violates some design contracts of theSetinterface.- 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 Modifier and Type Class Description classIdentitySet.EntryAn entry of theIdentitySet.
-
Constructor Summary
Constructors Constructor Description IdentitySet()Construct a set with default capacity.IdentitySet(int capacity)Construct a set with given capacity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Object key)booleanaddAll(java.util.Collection c)This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.voidclear()booleancontains(java.lang.Object key)booleancontainsAll(java.util.Collection c)In contrast with the design contract of theSetinterface this method has not been implemented and throws aUnsupportedOperationException.booleanisEmpty()java.util.Iteratoriterator()booleanremove(java.lang.Object key)booleanremoveAll(java.util.Collection c)This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.booleanretainAll(java.util.Collection c)This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.intsize()java.lang.Object[]toArray()java.lang.Object[]toArray(java.lang.Object[] a)
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection- Specified by:
clearin interfacejava.util.Set- See Also:
Collection.clear()
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.Set- See Also:
Collection.size()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection- Specified by:
isEmptyin interfacejava.util.Set- See Also:
Collection.isEmpty()
-
add
public boolean add(java.lang.Object key)
- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.Set- See Also:
Collection.add(java.lang.Object)
-
contains
public boolean contains(java.lang.Object key)
- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.Set- See Also:
Collection.contains(java.lang.Object)
-
remove
public boolean remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Collection- Specified by:
removein interfacejava.util.Set- See Also:
Collection.remove(java.lang.Object)
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.Set- See Also:
Collection.iterator()
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set- See Also:
Collection.toArray()
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set- See Also:
Collection.toArray(java.lang.Object[])
-
containsAll
public boolean containsAll(java.util.Collection c)
In contrast with the design contract of theSetinterface this method has not been implemented and throws aUnsupportedOperationException.- Specified by:
containsAllin interfacejava.util.Collection- Specified by:
containsAllin interfacejava.util.Set- See Also:
Set.containsAll(java.util.Collection<?>)
-
addAll
public boolean addAll(java.util.Collection c)
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
addAllin interfacejava.util.Collection- Specified by:
addAllin interfacejava.util.Set- See Also:
Set.addAll(java.util.Collection<? extends E>)
-
removeAll
public boolean removeAll(java.util.Collection c)
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
removeAllin interfacejava.util.Collection- Specified by:
removeAllin interfacejava.util.Set- See Also:
Set.removeAll(java.util.Collection<?>)
-
retainAll
public boolean retainAll(java.util.Collection c)
This optional method has not been implemented forIdentitySetinstead it throws aUnsupportedOperationExceptionas defined in theSetinterface.- Specified by:
retainAllin interfacejava.util.Collection- Specified by:
retainAllin interfacejava.util.Set- See Also:
Set.retainAll(java.util.Collection<?>)
-
-