com.isti.util
Class TwoObjectMatcher

java.lang.Object
  extended by com.isti.util.TwoObjectMatcher

public class TwoObjectMatcher
extends java.lang.Object

Class TwoObjectMatcher manages a set of object pairs and provides a fast comparison match vs. a given pair.


Constructor Summary
TwoObjectMatcher()
           
 
Method Summary
 void add(java.lang.Object obj1, java.lang.Object obj2)
          Adds the given pair of objects to this matcher.
 void clear()
          Removes all entries from this matcher.
 boolean contains(java.lang.Object obj1, java.lang.Object obj2)
          Checks if the given pair objects is held by this matcher.
 boolean isEmpty()
          Determines if this matcher is empty.
 boolean remove(java.lang.Object obj1, java.lang.Object obj2)
          Removes the given pair of objects from this matcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoObjectMatcher

public TwoObjectMatcher()
Method Detail

add

public void add(java.lang.Object obj1,
                java.lang.Object obj2)
Adds the given pair of objects to this matcher.

Parameters:
obj1 - the first object to use.
obj2 - the second object to use.

remove

public boolean remove(java.lang.Object obj1,
                      java.lang.Object obj2)
Removes the given pair of objects from this matcher.

Parameters:
obj1 - the first object of the pair to be removed.
obj2 - the second object of the pair to be removed.
Returns:
true if the given pair of objects was held in this matcher and was removed; false if the given pair of objects was not held in this matcher.

clear

public void clear()
Removes all entries from this matcher.


contains

public boolean contains(java.lang.Object obj1,
                        java.lang.Object obj2)
Checks if the given pair objects is held by this matcher.

Parameters:
obj1 - the first object to use.
obj2 - the second object to use.
Returns:
true if the given pair objects is held by this matcher, false if not.

isEmpty

public boolean isEmpty()
Determines if this matcher is empty.

Returns:
true if this matcher is empty; false if this matcher contains any objects.