simnet
Class Rule.RuleComp

java.lang.Object
  extended bysimnet.Rule.RuleComp
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
Rule

static class Rule.RuleComp
extends java.lang.Object
implements java.util.Comparator

A comparator for rules, based on their ID.


Constructor Summary
Rule.RuleComp()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two rules according to their ID.
 boolean equals(java.lang.Object o1, java.lang.Object o2)
          Determines if two rules have the same Rule ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

Rule.RuleComp

public Rule.RuleComp()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two rules according to their ID.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - the first Rule to compare
o2 - the second Rule to compare
Returns:
-1 if rule1 < rule2; 0 if rule1 == rule2; and 1 if rule1 > rule2

equals

public boolean equals(java.lang.Object o1,
                      java.lang.Object o2)
Determines if two rules have the same Rule ID.

Parameters:
o1 - first Rule to compare
o2 - second Rule to compare
Returns:
TRUE if rules have same ID; FALSE otherwise