org.castor.util

Class IdentitySet

Implemented Interfaces:
Set

public final class IdentitySet
extends java.lang.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.
Version:
$Revision: 6907 $ $Date: 2006-04-13 10:49:49 -0600 (Thu, 13 Apr 2006) $
Author:
Ralf Joachim
Since:
0.9.9

Nested Class Summary

class
IdentitySet.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

boolean
add(Object key)
boolean
addAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
void
clear()
boolean
contains(Object key)
boolean
containsAll(Collection c)
In contrast with the design contract of the Set interface this method has not been implemented and throws a UnsupportedOperationException.
boolean
isEmpty()
Iterator
iterator()
boolean
remove(Object key)
boolean
removeAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
boolean
retainAll(Collection c)
This optional method has not been implemented for IdentitySet instead it throws a UnsupportedOperationException as defined in the Set interface.
int
size()
Object[]
toArray()
Object[]
toArray(Object[] a)

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

add

public boolean add(Object key)
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.
See Also:
java.util.Set.addAll

clear

public void clear()
See Also:
java.util.Collection.clear()

contains

public boolean contains(Object key)
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.
See Also:
java.util.Set.containsAll

isEmpty

public boolean isEmpty()
See Also:
java.util.Collection.isEmpty()

iterator

public Iterator iterator()
See Also:
java.util.Collection.iterator()

remove

public boolean remove(Object key)
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.
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.
See Also:
java.util.Set.retainAll

size

public int size()
See Also:
java.util.Collection.size()

toArray

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

toArray

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

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