net.ontopia.utils
Class UniqueSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by net.ontopia.utils.CompactHashSet
              extended by net.ontopia.utils.UniqueSet
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.Set

public class UniqueSet
extends CompactHashSet

INTERNAL:


Constructor Summary
UniqueSet()
           
UniqueSet(java.util.Collection c)
           
UniqueSet(int size)
           
UniqueSet(UniqueSet s)
           
UniqueSet(UniqueSet s1, UniqueSet s2)
           
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the specified element to this set if it is not already present.
 UniqueSet add(UniqueSet set, java.lang.Object o, boolean dereference)
           
 boolean addAll(java.util.Collection coll)
           
 void clear()
          Removes all of the elements from this set.
 void dereference(UniqueSet set)
           
 void dump()
          INTERNAL: Used for debugging only.
 UniqueSet get(java.util.Set set)
          INTERNAL: Get the internal representation of a given set.
 int getReferenceCount()
           
 int hashCode()
           
 boolean remove(java.lang.Object o)
          Removes the specified element from the set.
 UniqueSet remove(UniqueSet set, java.lang.Object o, boolean dereference)
           
 boolean removeAll(java.util.Collection coll)
           
 boolean retainAll(java.util.Collection coll)
           
 java.lang.String toString()
           
 
Methods inherited from class net.ontopia.utils.CompactHashSet
contains, isEmpty, iterator, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSet
equals
 
Methods inherited from class java.util.AbstractCollection
containsAll
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll
 

Constructor Detail

UniqueSet

public UniqueSet()

UniqueSet

public UniqueSet(int size)

UniqueSet

public UniqueSet(java.util.Collection c)

UniqueSet

public UniqueSet(UniqueSet s)

UniqueSet

public UniqueSet(UniqueSet s1,
                 UniqueSet s2)
Method Detail

getReferenceCount

public int getReferenceCount()

get

public UniqueSet get(java.util.Set set)
INTERNAL: Get the internal representation of a given set. The initial reference count is 1.


dereference

public void dereference(UniqueSet set)

add

public UniqueSet add(UniqueSet set,
                     java.lang.Object o,
                     boolean dereference)

remove

public UniqueSet remove(UniqueSet set,
                        java.lang.Object o,
                        boolean dereference)

dump

public void dump()
Description copied from class: CompactHashSet
INTERNAL: Used for debugging only.

Overrides:
dump in class CompactHashSet

add

public boolean add(java.lang.Object o)
Description copied from class: CompactHashSet
Adds the specified element to this set if it is not already present.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set
Overrides:
add in class CompactHashSet
Parameters:
o - element to be added to this set.
Returns:
true if the set did not already contain the specified element.

remove

public boolean remove(java.lang.Object o)
Description copied from class: CompactHashSet
Removes the specified element from the set.

Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.Set
Overrides:
remove in class CompactHashSet

addAll

public boolean addAll(java.util.Collection coll)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.Set
Overrides:
addAll in class java.util.AbstractCollection

removeAll

public boolean removeAll(java.util.Collection coll)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.Set
Overrides:
removeAll in class java.util.AbstractSet

retainAll

public boolean retainAll(java.util.Collection coll)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.Set
Overrides:
retainAll in class java.util.AbstractCollection

clear

public void clear()
Description copied from class: CompactHashSet
Removes all of the elements from this set.

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.Set
Overrides:
clear in class CompactHashSet

toString

public java.lang.String toString()
Overrides:
toString in class java.util.AbstractCollection

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.Set
Overrides:
hashCode in class java.util.AbstractSet


Copyright © 2000-2009 Ontopia.