站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 3.0.6 API 英文版文档

EqualityKeyComparator - JBoss RULES 3.0.6 API 英文版文档


org.drools.common
Class EqualityKeyComparator

java.lang.Object
  extended by org.drools.util.FastComparator
      extended by org.drools.common.EqualityKeyComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class EqualityKeyComparator
extends FastComparator

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.drools.util.FastComparator
DEFAULT, DIRECT, IDENTITY, LEXICAL, REHASH, REHASH_SYSTEM_HASHCODE
 
Constructor Summary
EqualityKeyComparator()
           
 
Method Summary
 boolean areEqual(java.lang.Object o1, java.lang.Object o2)
          Equality key reverses the compare, so that the key controls the comparison
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares the specified objects for order.
static EqualityKeyComparator getInstance()
           
 int hashCodeOf(java.lang.Object obj)
          Returns the hash code for the specified object (consistent with FastComparator.areEqual(java.lang.Object, java.lang.Object)).
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

EqualityKeyComparator

public EqualityKeyComparator()
Method Detail

getInstance

public static EqualityKeyComparator getInstance()

hashCodeOf

public int hashCodeOf(java.lang.Object obj)
Description copied from class: FastComparator
Returns the hash code for the specified object (consistent with FastComparator.areEqual(java.lang.Object, java.lang.Object)). Two objects considered equal have the same hash code.

Specified by:
hashCodeOf in class FastComparator
Parameters:
obj - the object to return the hashcode for.
Returns:
the hashcode for the specified object.

areEqual

public boolean areEqual(java.lang.Object o1,
                        java.lang.Object o2)
Equality key reverses the compare, so that the key controls the comparison

Specified by:
areEqual in class FastComparator
Parameters:
o1 - the first object (or null).
o2 - the second object (or null).
Returns:
true if both objects are considered equal; false otherwise.

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Description copied from class: FastComparator
Compares the specified objects for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Specified by:
compare in interface java.util.Comparator
Specified by:
compare in class FastComparator
Parameters:
o1 - the first object.
o2 - the second object.
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object