net.sf.saxon.sort

Class ComparisonKey

public class ComparisonKey extends Object

An object used as a comparison key. Two XPath atomic values are equal under the "eq" operator if and only if their comparison keys are equal under the Java equals() method.
Field Summary
intcategory
Objectvalue
Constructor Summary
ComparisonKey(int category, Object value)
Create a comparison key for a value in a particular category.
Method Summary
booleanequals(Object other)
Test if two comparison keys are equal
inthashCode()
Get a hashcode for a comparison key.

Field Detail

category

int category

value

Object value

Constructor Detail

ComparisonKey

public ComparisonKey(int category, Object value)
Create a comparison key for a value in a particular category. The "category" here represents a set of primitive types that allow mutual comparison (so all numeric values are in the same category).

Parameters: category the category value the value within the category

Method Detail

equals

public boolean equals(Object other)
Test if two comparison keys are equal

Parameters: other the other comparison key

Returns: true if they are equal

Throws: ClassCastException if the other object is not a ComparisonKey

hashCode

public int hashCode()
Get a hashcode for a comparison key. If two comparison keys are equal, they must have the same hash code.

Returns: the hash code.