Class GlobalOrderComparer

  • All Implemented Interfaces:
    java.util.Comparator<Item>, ItemOrderComparer

    public final class GlobalOrderComparer
    extends java.lang.Object
    implements ItemOrderComparer
    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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(Item a, Item b)
      Compare two objects.
      static GlobalOrderComparer getInstance()
      Get an instance of a GlobalOrderComparer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • GlobalOrderComparer

        public GlobalOrderComparer()
    • Method Detail

      • getInstance

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

        public int compare​(Item a,
                           Item b)
        Description copied from interface: ItemOrderComparer
        Compare two objects.
        Specified by:
        compare in interface java.util.Comparator<Item>
        Specified by:
        compare in interface ItemOrderComparer
        Returns:
        <0 if a<b, 0 if a=b, >0 if a>b