org.castor.util

Class IdentitySet

public final class IdentitySet extends Object implements 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: 6230 $ $Date: 2006-04-13 10:49:49 -0600 (Thu, 13 Apr 2006) $

Author: Ralf Joachim

Nested Class Summary
classIdentitySet.Entry
An entry of the IdentitySet.
Constructor Summary
IdentitySet()
Construct a set with default capacity.
IdentitySet(int capacity)
Construct a set with given capacity.
Method Summary
booleanadd(Object key)
booleanaddAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
voidclear()
booleancontains(Object key)
booleancontainsAll(Collection c)
In contrast with the design contract of the Set interface this method has not been implemented and throws a UnsupportedOperationException.
booleanisEmpty()
Iteratoriterator()
booleanremove(Object key)
booleanremoveAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
booleanretainAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
intsize()
Object[]toArray()
Object[]toArray(Object[] a)

Constructor Detail

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 Detail

add

public boolean add(Object key)
{@inheritDoc }

See Also: java.util.Collection#add(java.lang.Object)

addAll

public boolean addAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface. {@inheritDoc }

See Also: java.util.Set#addAll

clear

public void clear()
{@inheritDoc }

See Also: java.util.Collection#clear()

contains

public boolean contains(Object key)
{@inheritDoc }

See Also: java.util.Collection#contains(java.lang.Object)

containsAll

public boolean containsAll(Collection c)
In contrast with the design contract of the Set interface this method has not been implemented and throws a UnsupportedOperationException. {@inheritDoc }

See Also: java.util.Set#containsAll

isEmpty

public boolean isEmpty()
{@inheritDoc }

See Also: java.util.Collection#isEmpty()

iterator

public Iterator iterator()
{@inheritDoc }

See Also: java.util.Collection#iterator()

remove

public boolean remove(Object key)
{@inheritDoc }

See Also: java.util.Collection#remove(java.lang.Object)

removeAll

public boolean removeAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface. {@inheritDoc }

See Also: java.util.Set#removeAll

retainAll

public boolean retainAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface. {@inheritDoc }

See Also: java.util.Set#retainAll

size

public int size()
{@inheritDoc }

See Also: java.util.Collection#size()

toArray

public Object[] toArray()
{@inheritDoc }

See Also: java.util.Collection#toArray()

toArray

public Object[] toArray(Object[] a)
{@inheritDoc }

See Also: java.util.Collection#toArray(java.lang.Object[])

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com