Top Description Fields Constructors Methods
org.antlr.runtime.misc

public Class DoubleKeyMap<Key1, Key2, Value>

extends Object
Class Inheritance
Imports
java.util.*

Sometimes we need to map a key to a value but key is two pieces of data. This nested hash table saves creating a single key each time we access map; avoids mem creation.

Field Summary

Modifier and TypeField and Description
pack-priv Map<Key1, Map<Key2, Value>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Value
get(Key1 k1, Key2 k2)

public Map<Key2, Value>
get(Key1 k1)

public Set<Key1>
keySet()

get all primary keys

public Set<Key2>
keySet(Key1 k1)

get all secondary keys associated with a primary key

public Value
put(Key1 k1, Key2 k2, Value v)

public Collection<Value>
values(Key1 k1)

Get all values associated with primary key

public Collection<Value>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv Map<Key1, Map<Key2, Value>> data

Constructor Detail

DoubleKeyMapback to summary
public DoubleKeyMap()

Method Detail

getback to summary
public Value get(Key1 k1, Key2 k2)
getback to summary
public Map<Key2, Value> get(Key1 k1)
keySetback to summary
public Set<Key1> keySet()

get all primary keys

keySetback to summary
public Set<Key2> keySet(Key1 k1)

get all secondary keys associated with a primary key

putback to summary
public Value put(Key1 k1, Key2 k2, Value v)
valuesback to summary
public Collection<Value> values(Key1 k1)

Get all values associated with primary key

valuesback to summary
public Collection<Value> values()