net.ontopia.utils
Class CompactIdentityHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.ontopia.utils.CompactHashSet<E>
net.ontopia.utils.CompactIdentityHashSet<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, 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.
Method Summary |
boolean |
add(Object o)
Adds the specified element to this set if it is not already
present. |
boolean |
contains(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(Object o)
Removes the specified element from the set. |
CompactIdentityHashSet
public CompactIdentityHashSet()
CompactIdentityHashSet
public CompactIdentityHashSet(int size)
CompactIdentityHashSet
public CompactIdentityHashSet(Collection<E> coll)
contains
public boolean contains(Object o)
- Returns true if this set contains the specified element.
- Specified by:
contains
in interface Collection<E>
- Specified by:
contains
in interface 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(Object o)
- Adds the specified element to this set if it is not already
present.
- Specified by:
add
in interface Collection<E>
- Specified by:
add
in interface 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(Object o)
- Removes the specified element from the set.
- Specified by:
remove
in interface Collection<E>
- Specified by:
remove
in interface 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.