All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.certificate.TwoKeyTable

java.lang.Object
   |
   +----semper.certificate.TwoKeyTable

public class TwoKeyTable
extends Object
implements Serializable
Manages many-to-many relationship between to types of keys (key1 and key2 objects). A number of key2 objects can be stored under a key1 objects. A given key2 object can be stored under several key1 obects. This class manages that relationsip and provides easy access to information stored under either key1 or key2 objects.


Constructor Index

 o TwoKeyTable()
Empty constructor.

Method Index

 o addPair(Object, Object)
Adds a pair of elements.
 o deleteKey(int, Object)
Removes the given key from the table.
 o getAllKeys(int)
Get all keys
 o getObjects(int, Object)
Get objects
 o removePair(Object, Object)
Removes a pair of elements.

Constructors

 o TwoKeyTable
 public TwoKeyTable()
Empty constructor.

Methods

 o addPair
 public void addPair(Object key1,
                     Object key2)
Adds a pair of elements. If the pair is already added, nothing is done.

Parameters:
key1 - first key in pair to be added
key2 - second key in pair to be added
 o removePair
 public void removePair(Object key1,
                        Object key2)
Removes a pair of elements.

Parameters:
key1 - first key in pair to be removed
key2 - second key in pair to be removed
 o getAllKeys
 public Enumeration getAllKeys(int index)
Get all keys

Parameters:
if - index is 1 all key1 objects in the table are returned if it is 2 all key2 objects are returned.
Returns:
an Enumeration of all key objects as defined by the parameter
 o getObjects
 public Vector getObjects(int index,
                          Object key)
Get objects

Parameters:
if - index is 1 the key parameter is interpreted as a key1 object and if it's 2 the key parameter must be a key2 object.
key - the key for which all associated objects are requested
Returns:
a Vector of all objects sotred under the given key
 o deleteKey
 public void deleteKey(int index,
                       Object key)
Removes the given key from the table.

Parameters:
if - index is 1 the key parameter is interpreted as a key1 object and if it's 2 the key parameter must be a key2 object.
key - the key for which all associated objects are requested

All Packages  Class Hierarchy  This Package  Previous  Next  Index