soot.toolkits.scalar
Class ObjectIntMapper<E>

java.lang.Object
  extended by soot.toolkits.scalar.ObjectIntMapper<E>

public class ObjectIntMapper<E>
extends Object

gives an injection of Objects to ints. Different instances of ObjectIntMap may map different ints to the same object.


Constructor Summary
ObjectIntMapper()
           
ObjectIntMapper(Collection<E> collection)
           
ObjectIntMapper(FlowUniverse<E> flowUniverse)
           
 
Method Summary
 int add(E o)
          adds o into the map.
 boolean contains(Object o)
          returns true, if o has already been mapped.
 int getInt(E o)
          returns the mapping of o.
 Object getObject(int i)
          returns the object associated to i.
 int size()
          returns the number of mapped objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectIntMapper

public ObjectIntMapper()

ObjectIntMapper

public ObjectIntMapper(FlowUniverse<E> flowUniverse)

ObjectIntMapper

public ObjectIntMapper(Collection<E> collection)
Method Detail

add

public int add(E o)
adds o into the map. no test are made, if it is already in the map.


getInt

public int getInt(E o)
returns the mapping of o. if there has been a call to objectToInt with the same o before, the same value will be returned.

Parameters:
o -
Returns:
o's mapping

getObject

public Object getObject(int i)
returns the object associated to i.

Parameters:
i -
Returns:
i's object

contains

public boolean contains(Object o)
returns true, if o has already been mapped.

Parameters:
o -
Returns:
true if o has already a number.

size

public int size()
returns the number of mapped objects.