Package soot.toolkits.scalar
Class ObjectIntMapper<E>
- java.lang.Object
-
- soot.toolkits.scalar.ObjectIntMapper<E>
-
public class ObjectIntMapper<E> extends Object
Gives an injection of Objects to ints. Different instances may map different ints to the same object.
-
-
Constructor Summary
Constructors Constructor Description ObjectIntMapper()ObjectIntMapper(Collection<E> collection)ObjectIntMapper(FlowUniverse<E> flowUniverse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(E o)addsointo the map.booleancontains(Object o)returns true, ifohas already been mapped.intgetInt(E o)returns the mapping ofo.EgetObject(int i)returns the object associated toi.intsize()returns the number of mapped objects.
-
-
-
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)
addsointo the map. no test are made, if it is already in the map.
-
getInt
public int getInt(E o)
returns the mapping ofo. if there has been a call toobjectToIntwith the sameobefore, the same value will be returned.- Parameters:
o-- Returns:
o's mapping
-
getObject
public E getObject(int i)
returns the object associated toi.- Parameters:
i-- Returns:
i's object
-
contains
public boolean contains(Object o)
returns true, ifohas already been mapped.- Parameters:
o-- Returns:
- true if
ohas already a number.
-
size
public int size()
returns the number of mapped objects.
-
-