|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> net.ontopia.utils.CompactHashSet net.ontopia.utils.SetPool
public class SetPool
INTERNAL: The default SetPool implementation.
Field Summary | |
---|---|
protected PoolableSetFactoryIF |
factory
|
protected int |
hc
|
protected int |
hc_modCount
|
Fields inherited from class net.ontopia.utils.CompactHashSet |
---|
deletedObject, elements, freecells, INITIAL_SIZE, LOAD_FACTOR, modCount, nullObject, objects |
Constructor Summary | |
---|---|
SetPool()
|
|
SetPool(java.util.Collection c)
|
|
SetPool(java.util.Collection c,
PoolableSetFactoryIF factory)
|
|
SetPool(int size)
|
|
SetPool(int size,
PoolableSetFactoryIF factory)
|
|
SetPool(PoolableSetFactoryIF factory)
|
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already present. |
java.util.Set |
add(java.util.Set set,
java.lang.Object o,
boolean dereference)
INTERNAL: Return a set that is the result of adding the given object from the given set. |
boolean |
addAll(java.util.Collection coll)
|
void |
clear()
Removes all of the elements from this set. |
PoolableSetIF |
createSet()
INTERNAL: Returns a new empty poolable set. |
PoolableSetIF |
createSet(java.util.Set set)
INTERNAL: Returns a new poolable set that contains the given elements. |
PoolableSetIF |
createSetAdd(java.util.Set set,
java.lang.Object o)
INTERNAL: Returns a new poolable set that contains the given elements plus the single object. |
PoolableSetIF |
createSetRemove(java.util.Set set,
java.lang.Object o)
INTERNAL: Returns a new poolable set that contains the given elements minus the single object. |
void |
dereference(java.util.Set set)
INTERNAL: Decrement reference count for the given set. |
void |
dump()
INTERNAL: Used for debugging only. |
int |
hashCode()
|
protected java.lang.Object |
lookup(java.lang.Object o)
INTERNAL: Looks up the object in the hashset and returns the actual object stored at the hashset. |
java.util.Set |
reference(java.util.Set set)
INTERNAL: Get the internal representation of a given set. |
protected void |
registerSet(java.util.Set set)
|
boolean |
remove(java.lang.Object o)
Removes the specified element from the set. |
java.util.Set |
remove(java.util.Set set,
java.lang.Object o,
boolean dereference)
INTERNAL: Return a set that is the result of removing the given object from the given set. |
boolean |
removeAll(java.util.Collection coll)
|
boolean |
retainAll(java.util.Collection coll)
|
protected void |
unregisterSet(java.util.Set set)
|
Methods inherited from class net.ontopia.utils.CompactHashSet |
---|
contains, isEmpty, iterator, rehash, rehash, size, toArray, toArray |
Methods inherited from class java.util.AbstractSet |
---|
equals |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
contains, containsAll, equals, isEmpty, iterator, size, toArray, toArray |
Field Detail |
---|
protected PoolableSetFactoryIF factory
protected int hc
protected int hc_modCount
Constructor Detail |
---|
public SetPool()
public SetPool(PoolableSetFactoryIF factory)
public SetPool(int size)
public SetPool(int size, PoolableSetFactoryIF factory)
public SetPool(java.util.Collection c)
public SetPool(java.util.Collection c, PoolableSetFactoryIF factory)
Method Detail |
---|
public PoolableSetIF createSet()
PoolableSetFactoryIF
createSet
in interface PoolableSetFactoryIF
public PoolableSetIF createSet(java.util.Set set)
PoolableSetFactoryIF
createSet
in interface PoolableSetFactoryIF
public PoolableSetIF createSetAdd(java.util.Set set, java.lang.Object o)
PoolableSetFactoryIF
createSetAdd
in interface PoolableSetFactoryIF
public PoolableSetIF createSetRemove(java.util.Set set, java.lang.Object o)
PoolableSetFactoryIF
createSetRemove
in interface PoolableSetFactoryIF
protected void registerSet(java.util.Set set)
protected void unregisterSet(java.util.Set set)
public java.util.Set reference(java.util.Set set)
reference
in interface SetPoolIF
public void dereference(java.util.Set set)
SetPoolIF
dereference
in interface SetPoolIF
protected java.lang.Object lookup(java.lang.Object o)
public java.util.Set add(java.util.Set set, java.lang.Object o, boolean dereference)
SetPoolIF
add
in interface SetPoolIF
public java.util.Set remove(java.util.Set set, java.lang.Object o, boolean dereference)
SetPoolIF
remove
in interface SetPoolIF
public void dump()
CompactHashSet
dump
in class CompactHashSet
public boolean add(java.lang.Object o)
CompactHashSet
add
in interface java.util.Collection
add
in interface java.util.Set
add
in class CompactHashSet
o
- element to be added to this set.
public boolean remove(java.lang.Object o)
CompactHashSet
remove
in interface java.util.Collection
remove
in interface java.util.Set
remove
in class CompactHashSet
public boolean addAll(java.util.Collection coll)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
addAll
in class java.util.AbstractCollection
public boolean removeAll(java.util.Collection coll)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
removeAll
in class java.util.AbstractSet
public boolean retainAll(java.util.Collection coll)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
retainAll
in class java.util.AbstractCollection
public void clear()
CompactHashSet
clear
in interface java.util.Collection
clear
in interface java.util.Set
clear
in class CompactHashSet
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.Set
hashCode
in class java.util.AbstractSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |