public class SimplePool<E> extends Object
Constructor and Description |
---|
SimplePool()
Creates a SimplePool that holds about 716 elements before first
rehash.
|
SimplePool(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)
Test main.
|
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 SimplePool()
public SimplePool(int pow)
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)