net.ontopia.utils
Class CompactIdentityHashSet<E>

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

public class CompactIdentityHashSet<E>
extends CompactHashSet<E>

INTERNAL: This class is a specialization of the CompactHashSet class, and uses the == operator to compare objects.


Field Summary
 
Fields inherited from class net.ontopia.utils.CompactHashSet
deletedObject, elements, freecells, INITIAL_SIZE, LOAD_FACTOR, modCount, nullObject, objects
 
Constructor Summary
CompactIdentityHashSet()
           
CompactIdentityHashSet(java.util.Collection<E> coll)
           
CompactIdentityHashSet(int size)
           
 
Method Summary
 boolean add(java.lang.Object o)
          Adds the specified element to this set if it is not already present.
 boolean contains(java.lang.Object o)
          Returns true if this set contains the specified element.
protected  void rehash(int newCapacity)
          INTERNAL: Rehashes the hashset to a bigger size.
 boolean remove(java.lang.Object o)
          Removes the specified element from the set.
 
Methods inherited from class net.ontopia.utils.CompactHashSet
clear, dump, isEmpty, iterator, rehash, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, retainAll
 

Constructor Detail

CompactIdentityHashSet

public CompactIdentityHashSet()

CompactIdentityHashSet

public CompactIdentityHashSet(int size)

CompactIdentityHashSet

public CompactIdentityHashSet(java.util.Collection<E> coll)
Method Detail

contains

public boolean contains(java.lang.Object o)
Returns true if this set contains the specified element.

Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.Set<E>
Overrides:
contains in class CompactHashSet<E>
Parameters:
o - element whose presence in this set is to be tested.
Returns:
true if this set contains the specified element.

add

public boolean add(java.lang.Object o)
Adds the specified element to this set if it is not already present.

Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.Set<E>
Overrides:
add in class CompactHashSet<E>
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)
Removes the specified element from the set.

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

rehash

protected void rehash(int newCapacity)
INTERNAL: Rehashes the hashset to a bigger size.

Overrides:
rehash in class CompactHashSet<E>


Copyright © 2000-2012 Ontopia.