AddressMappublic final class AddressMap extends Object Map from addresses to addresses, where addresses are all
{@code int}s. |
Fields Summary |
---|
private final HashMap | mapunderlying map. TODO: This might be too inefficient. |
Constructors Summary |
---|
public AddressMap()Constructs an instance.
map = new HashMap<Integer,Integer>();
|
Methods Summary |
---|
public int | get(int keyAddress)Gets the value address corresponding to the given key address. Returns
{@code -1} if there is no mapping.
Integer value = map.get(keyAddress);
return (value == null) ? -1 : value;
| public void | put(int keyAddress, int valueAddress)Sets the value address associated with the given key address.
map.put(keyAddress, valueAddress);
|
|