public class WeakPool<E> extends Object
Constructor and Description |
---|
WeakPool()
Creates a SimplePool that holds about 716 elements before first
rehash.
|
WeakPool(int pow)
Creates a SimplePool that holds about 0.7 * 2**pow elements before
first rehash.
|
Modifier and Type | Method and Description |
---|---|
void |
add(E e) |
boolean |
isMember(E e) |
boolean |
isPooled(E e)
Asks whether a particular element is already pooled.
|
static void |
main(String[] args)
BROKEN Test main.
|
protected void |
newTable() |
E |
pool(E e)
Returns a pooled element matching e, which will be e if no match
has been previously pooled.
|
E |
query(E e)
Returns the matching element if there is one, null if not.
|
public WeakPool()
public WeakPool(int pow)
protected void newTable()
public boolean isPooled(E e)
public E pool(E e)
public boolean isMember(E e)
public void add(E e)
public static void main(String[] args)