public class ZArrayNumberer<E extends Numberable> extends java.lang.Object implements IterableNumberer<E>, java.lang.Iterable<E>
Constructor and Description |
---|
ZArrayNumberer() |
ZArrayNumberer(int initSize) |
Modifier and Type | Method and Description |
---|---|
void |
add(E o)
Tells the numberer that a new object needs to be assigned a number.
|
void |
clear()
Clear the reference to the objects to help the garbage collection
|
long |
get(E o)
Input object o should be added to this container previously.
|
E |
get(long number)
Should return the object that was assigned the number number.
|
java.util.Iterator<E> |
iterator()
Returns an iterator over all objects added to the numberer.
|
void |
reassign()
The removed objects cause some empty slots.
|
boolean |
remove(E o) |
E |
searchFor(E o)
Input object o is not required to be an object added previously.
|
int |
size()
Return how many objects are in the container but not the capacity of the container.
|
public ZArrayNumberer()
public ZArrayNumberer(int initSize)
public void add(E o)
Numberer
add
in interface Numberer<E extends Numberable>
public void clear()
public long get(E o)
get
in interface Numberer<E extends Numberable>
public E get(long number)
Numberer
get
in interface Numberer<E extends Numberable>
public E searchFor(E o)
o
- public boolean remove(E o)
public int size()
size
in interface Numberer<E extends Numberable>
public void reassign()
public java.util.Iterator<E> iterator()
IterableNumberer
iterator
in interface java.lang.Iterable<E extends Numberable>
iterator
in interface IterableNumberer<E extends Numberable>