fipaos.tool.configurator
Class TwoWayMapping


public class TwoWayMapping

TwoWayMapping is a convenience class that allows bidirectional lookup between unique pairs of values. It is essentially a hashtable that can be searched using either keys or values. The semantics for this class only hold if no object exists as both a key and a value (unless they are a unique pair).


Constructor Summary
TwoWayMapping()
          Constructs a new TwoWayMapping

Method Summary
 Objectget(Object key)
          Attempts to retrieve the "other half" of a pair that is mapped to the supplied object.
 voidput(Object first, Object second)
          Puts a pair of objects into the TwoWayMapping.

Constructor Detail

TwoWayMapping

public TwoWayMapping()
Constructs a new TwoWayMapping
Method Detail

get

public Object get(Object key)
Attempts to retrieve the "other half" of a pair that is mapped to the supplied object.
Parameters:
key. - One half of a pair.
Returns: The matching object if one is found, null if not.

put

public void put(Object first, Object second)
Puts a pair of objects into the TwoWayMapping. The order of the objects should not matter.
Parameters:
first. - The first object in the pair.
second. - The second object in the pair.

Association Links

to Class java.util.Hashtable

to Class java.util.Hashtable