soot.jimple.spark.geom.geomPA
Class ZArrayNumberer<E extends Numberable>

java.lang.Object
  extended by soot.jimple.spark.geom.geomPA.ZArrayNumberer<E>
Type Parameters:
E -
All Implemented Interfaces:
Iterable<E>, IterableNumberer<E>, Numberer<E>

public class ZArrayNumberer<E extends Numberable>
extends Object
implements IterableNumberer<E>, Iterable<E>

Similar to the ArrayNumberer in soot. But, this class counts the objects from zero. And, we permit the deletion of objects from the array container. And most importantly, we permits the search for a particular object efficiently. Therefore, this class supports both efficiently insert, lookup, deletion and list queries.

Author:
richardxx

Constructor Summary
ZArrayNumberer()
           
 
Method Summary
 void add(E o)
          Tells the numberer that a new object needs to be assigned a number.
 void clear()
           
 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.
 Iterator<E> iterator()
          Returns an iterator over all objects added to the numberer.
 boolean remove(E o)
           
 E searchFor(E o)
          Input object o is not required to be an object added previously.
 int size()
          Should return the number of objects that have been assigned numbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZArrayNumberer

public ZArrayNumberer()
Method Detail

add

public void add(E o)
Description copied from interface: Numberer
Tells the numberer that a new object needs to be assigned a number.

Specified by:
add in interface Numberer<E extends Numberable>

clear

public void clear()

get

public long get(E o)
Input object o should be added to this container previously.

Specified by:
get in interface Numberer<E extends Numberable>

get

public E get(long number)
Description copied from interface: Numberer
Should return the object that was assigned the number number.

Specified by:
get in interface Numberer<E extends Numberable>

searchFor

public E searchFor(E o)
Input object o is not required to be an object added previously.

Parameters:
o -
Returns:

remove

public boolean remove(E o)

size

public int size()
Description copied from interface: Numberer
Should return the number of objects that have been assigned numbers.

Specified by:
size in interface Numberer<E extends Numberable>

iterator

public Iterator<E> iterator()
Description copied from interface: IterableNumberer
Returns an iterator over all objects added to the numberer.

Specified by:
iterator in interface Iterable<E extends Numberable>
Specified by:
iterator in interface IterableNumberer<E extends Numberable>