com.icl.saxon.sort

Class Comparer

public abstract class Comparer extends Object

A Comparer used for comparing keys

Author: Michael H. Kay

Method Summary
abstract intcompare(Object a, Object b)
Compare two objects.
ComparersetDataType(String dataTypeURI, String dataTypeLocalName)
Set data type.
ComparersetOrder(boolean isAscending)
Set order.

Method Detail

compare

public abstract int compare(Object a, Object b)
Compare two objects.

Returns: <0 if a0 if a>b

Throws: ClassCastException if the objects are of the wrong type for this Comparer

setDataType

public Comparer setDataType(String dataTypeURI, String dataTypeLocalName)
Set data type. The comparer has the option of returning a different comparer once it knows the data type

setOrder

public Comparer setOrder(boolean isAscending)
Set order. The comparer has the option of returning a different comparer