org.apache.ojb.broker.util
Class DoubleHashtable

java.lang.Object
  extended by org.apache.ojb.broker.util.DoubleHashtable

public class DoubleHashtable
extends Object

this class can be used to build two-way lookup tables. It provides lookup from keys to values and the inverse lookup from values to keys.

Version:
$Id: DoubleHashtable.java,v 1.1 2007-08-24 22:17:36 ewestfal Exp $
Author:
Thomas Mahler

Constructor Summary
DoubleHashtable()
          public default constructor.
 
Method Summary
 Object getKeyByValue(Object value)
          lookup a key from the table by its value.
 Object getValueByKey(Object key)
          lookup a value from the table by its key.
 void put(Object key, Object value)
          put a (key, value) pair into the table.
 void removeByKey(Object key)
          remove a (key, value)-entry by its key
 void removeByValue(Object value)
          remove a (key, value)-entry by its value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleHashtable

public DoubleHashtable()
public default constructor.

Method Detail

put

public void put(Object key,
                Object value)
put a (key, value) pair into the table.

Parameters:
key - the key object.
value - the value object.

getValueByKey

public Object getValueByKey(Object key)
lookup a value from the table by its key.

Parameters:
key - the key object
Returns:
the associated value object

getKeyByValue

public Object getKeyByValue(Object value)
lookup a key from the table by its value.

Parameters:
value - the value object
Returns:
the associated key object

removeByKey

public void removeByKey(Object key)
remove a (key, value)-entry by its key

Parameters:
key - the key object

removeByValue

public void removeByValue(Object value)
remove a (key, value)-entry by its value

Parameters:
value - the value object


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.