net.sf.saxon.sort

Class LocalOrderComparer

Implemented Interfaces:
NodeOrderComparer, Serializable

public final class LocalOrderComparer
extends java.lang.Object
implements NodeOrderComparer, Serializable

A Comparer used for comparing nodes in document order. This comparer assumes that the nodes being compared come from the same document
Author:
Michael H. Kay

Method Summary

int
compare(NodeInfo a, NodeInfo b)
Compare two objects.
static LocalOrderComparer
getInstance()
Get an instance of a LocalOrderComparer.

Method Details

compare

public int compare(NodeInfo a,
                   NodeInfo b)
Compare two objects.
Specified by:
compare in interface NodeOrderComparer
Returns:
<0 if a0 if a>b

getInstance

public static LocalOrderComparer getInstance()
Get an instance of a LocalOrderComparer. The class maintains no state so this returns the same instance every time.