vanetsim.routing.A_Star
Class A_Star_LookupTable<K,V>

java.lang.Object
  extended by vanetsim.routing.A_Star.A_Star_LookupTable<K,V>

public class A_Star_LookupTable<K,V>
extends java.lang.Object

A LookupTable for the mapping between Nodes and A_Star_Nodes. Uses the nodeid to construct an extremely very efficient lookup in an array. This has a far better performance than traditional HashMaps because no hashing is needed and no collisions can occur.
If you encounter any problems you may switch to the standard Java Hashmap by just replacing all occurences.


Constructor Summary
A_Star_LookupTable(int initialCapacity)
          Constructs an empty LookupTable.
 
Method Summary
 A_Star_Node get(Node key)
          Returns the value to which the specified node is mapped, or null if this map contains no mapping for the key.
 void put(Node key, A_Star_Node value)
          Associates the specified value with the specified key in this map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

A_Star_LookupTable

public A_Star_LookupTable(int initialCapacity)
Constructs an empty LookupTable.

Parameters:
initialCapacity - the initial capacity.
Method Detail

get

public A_Star_Node get(Node key)
Returns the value to which the specified node is mapped, or null if this map contains no mapping for the key.


put

public void put(Node key,
                A_Star_Node value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Parameters:
key - key with which the specified value is to be associated
value - value to be associated with the specified key