soot.util
Class ArrayNumberer<E>

java.lang.Object
  extended by soot.util.ArrayNumberer<E>
All Implemented Interfaces:
IterableNumberer<E>, Numberer<E>
Direct Known Subclasses:
StringNumberer

public class ArrayNumberer<E>
extends Object
implements IterableNumberer<E>

A class that numbers objects, so they can be placed in bitsets.

Author:
Ondrej Lhotak, xiao, generalize it.

Constructor Summary
ArrayNumberer()
           
 
Method Summary
 void add(E oo)
          Tells the numberer that a new object needs to be assigned a number.
 long get(E oo)
          Should return the number that was assigned to object o that was previously passed as an argument to add().
 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.
 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

ArrayNumberer

public ArrayNumberer()
Method Detail

add

public void add(E oo)
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>

get

public long get(E oo)
Description copied from interface: Numberer
Should return the number that was assigned to object o that was previously passed as an argument to add().

Specified by:
get in interface Numberer<E>

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>

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>

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 IterableNumberer<E>