Class AstNode.PositionComparator

java.lang.Object
org.mozilla.javascript.ast.AstNode.PositionComparator
All Implemented Interfaces:
Serializable, Comparator<AstNode>
Enclosing class:
AstNode

public static class AstNode.PositionComparator extends Object implements Comparator<AstNode>, Serializable
See Also:
  • Constructor Details

    • PositionComparator

      public PositionComparator()
  • Method Details

    • compare

      public int compare(AstNode n1, AstNode n2)
      Sorts nodes by (relative) start position. The start positions are relative to their parent, so this comparator is only meaningful for comparing siblings.
      Specified by:
      compare in interface Comparator<AstNode>