net.sf.saxon.sort

Class GlobalOrderComparer

Implemented Interfaces:
NodeOrderComparer, Serializable

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

A Comparer used for comparing nodes in document order. This comparer is used when there is no guarantee 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 GlobalOrderComparer
getInstance()
Get an instance of a GlobalOrderComparer.

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 GlobalOrderComparer getInstance()
Get an instance of a GlobalOrderComparer. The class maintains no state so this returns the same instance every time.