Package edu.umd.cs.findbugs.ba.vna
Class ValueNumberFrame.AvailableLoadBiMap
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.AvailableLoadBiMap
-
- Enclosing class:
- ValueNumberFrame
private static class ValueNumberFrame.AvailableLoadBiMap extends java.lang.Object
A wrapper for the AvailableLoad to ValueNumber[] map also keeping track of a reverse map. There are a lot of calls toValueNumberFrame.getLoad(ValueNumber)
so it is faster using a reverse map compared to doing a linear search
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<AvailableLoad,ValueNumber[]>
map
private java.util.Map<ValueNumber,AvailableLoad>
reverseMap
-
Constructor Summary
Constructors Constructor Description AvailableLoadBiMap(java.util.Map<AvailableLoad,ValueNumber[]> map)
AvailableLoadBiMap(java.util.Map<AvailableLoad,ValueNumber[]> map, java.util.Map<ValueNumber,AvailableLoad> reverseMap)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValueNumberFrame.AvailableLoadBiMap
emptyMap()
java.util.Set<java.util.Map.Entry<AvailableLoad,ValueNumber[]>>
entrySet()
ValueNumber[]
get(AvailableLoad key)
AvailableLoad
getLoad(ValueNumber v)
boolean
isEmpty()
boolean
isModifiable()
java.util.Set<AvailableLoad>
keySet()
ValueNumber[]
put(AvailableLoad key, ValueNumber[] value)
Put an array ofValueNumber
for anAvailableLoad
and update the reverse mapValueNumber[]
remove(AvailableLoad key)
Remove anAvailableLoad
and update the reverse mapint
size()
static ValueNumberFrame.AvailableLoadBiMap
unmodifiableMap(ValueNumberFrame.AvailableLoadBiMap other)
void
updateEntryValue(java.util.Map.Entry<AvailableLoad,ValueNumber[]> e, ValueNumber value)
-
-
-
Field Detail
-
map
private final java.util.Map<AvailableLoad,ValueNumber[]> map
-
reverseMap
private final java.util.Map<ValueNumber,AvailableLoad> reverseMap
-
-
Constructor Detail
-
AvailableLoadBiMap
public AvailableLoadBiMap(java.util.Map<AvailableLoad,ValueNumber[]> map)
-
AvailableLoadBiMap
public AvailableLoadBiMap(java.util.Map<AvailableLoad,ValueNumber[]> map, java.util.Map<ValueNumber,AvailableLoad> reverseMap)
-
-
Method Detail
-
emptyMap
public static ValueNumberFrame.AvailableLoadBiMap emptyMap()
- Returns:
- an empty (unmodifiable)
ValueNumberFrame.AvailableLoadBiMap
-
unmodifiableMap
public static ValueNumberFrame.AvailableLoadBiMap unmodifiableMap(ValueNumberFrame.AvailableLoadBiMap other)
- Parameters:
other
- The map we want to copy- Returns:
- an unmodifiable copy backed by the
other
ValueNumberFrame.AvailableLoadBiMap
-
size
public int size()
- Returns:
- The number of distinct
AvailableLoad
in this map
-
isEmpty
public boolean isEmpty()
-
keySet
public java.util.Set<AvailableLoad> keySet()
-
entrySet
public java.util.Set<java.util.Map.Entry<AvailableLoad,ValueNumber[]>> entrySet()
-
get
public ValueNumber[] get(AvailableLoad key)
-
put
public ValueNumber[] put(AvailableLoad key, ValueNumber[] value)
Put an array ofValueNumber
for anAvailableLoad
and update the reverse map
-
updateEntryValue
public void updateEntryValue(java.util.Map.Entry<AvailableLoad,ValueNumber[]> e, ValueNumber value)
-
remove
public ValueNumber[] remove(AvailableLoad key)
Remove anAvailableLoad
and update the reverse map
-
getLoad
public AvailableLoad getLoad(ValueNumber v)
-
isModifiable
public boolean isModifiable()
-
-