Package soot.util
Class UnitMap<T>
- java.lang.Object
-
- soot.util.UnitMap<T>
-
-
Constructor Summary
Constructors Constructor Description UnitMap(Body b)maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized without any parameter.UnitMap(Body b, int initialCapacity)maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacity.UnitMap(Body b, int initialCapacity, float loadFactor)maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacityandloadFactor.UnitMap(UnitGraph g)maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized without any parameter.UnitMap(UnitGraph g, int initialCapacity)maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacity.UnitMap(UnitGraph g, int initialCapacity, float loadFactor)maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacityandloadFactor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<Unit,T>>entrySet()booleanequals(Object o)Tget(Object key)inthashCode()protected voidinit()allows one-time initialization before any mapping.booleanisEmpty()Set<Unit>keySet()protected abstract TmapTo(Unit unit)maps a unit to an object.Tput(Unit key, T value)voidputAll(Map<? extends Unit,? extends T> t)Tremove(Object key)intsize()Collection<T>values()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
UnitMap
public UnitMap(Body b)
maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized without any parameter.- Parameters:
b- a Body
-
UnitMap
public UnitMap(UnitGraph g)
maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized without any parameter.- Parameters:
g- a UnitGraph
-
UnitMap
public UnitMap(Body b, int initialCapacity)
maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacity.- Parameters:
b- a BodyinitialCapacity- the initialCapacity of the internal map.
-
UnitMap
public UnitMap(UnitGraph g, int initialCapacity)
maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacity.- Parameters:
g- a UnitGraphinitialCapacity- the initialCapacity of the internal map.
-
UnitMap
public UnitMap(Body b, int initialCapacity, float loadFactor)
maps each unit of this body to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacityandloadFactor.- Parameters:
b- a BodyinitialCapacity- the initialCapacity of the internal map.loadFactor- the loadFactor of the internal map.
-
UnitMap
public UnitMap(UnitGraph g, int initialCapacity, float loadFactor)
maps each unit of the graph to the result ofmapTo.
before the mapping the methodinitis called.
the internal map is initialized toinitialCapacityandloadFactor.- Parameters:
g- a UnitGraphinitialCapacity- the initialCapacity of the internal map.loadFactor- the loadFactor of the internal map.
-
-
Method Detail
-
init
protected void init()
allows one-time initialization before any mapping. This method is called before any mapping of a unit (but only once in the beginning).
If not overwritten does nothing.
-
mapTo
protected abstract T mapTo(Unit unit)
maps a unit to an object. This method is called for every unit. If the returned object isnullno object will be mapped.- Parameters:
unit- Unit to whichoshould be mapped.- Returns:
- an object that is mapped to the unit, or
null.
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<Unit,T>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<Unit,T>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
-