Class LocalOrderComparer

  • All Implemented Interfaces:
    java.util.Comparator<NodeInfo>

    public final class LocalOrderComparer
    extends java.lang.Object
    implements java.util.Comparator<NodeInfo>
    A Comparer used for comparing nodes in document order. This comparer assumes 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​(NodeInfo a, NodeInfo b)  
      static LocalOrderComparer getInstance()
      Get an instance of a LocalOrderComparer.
      • 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

      • LocalOrderComparer

        public LocalOrderComparer()
    • Method Detail

      • getInstance

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

        public int compare​(NodeInfo a,
                           NodeInfo b)
        Specified by:
        compare in interface java.util.Comparator<NodeInfo>