Class CtLineElementComparator

All Implemented Interfaces:
Serializable, Comparator<CtElement>

public class CtLineElementComparator extends Object implements Comparator<CtElement>, Serializable
Comparator of compile-time elements. Elements are sorted by position in source files.
See Also:
Serialized Form
  • Constructor Details

    • CtLineElementComparator

      public CtLineElementComparator()
  • Method Details

    • compare

      public int compare(CtElement o1, CtElement o2)
      Returns 0 if o1 has the same position as o2, or both positions are invalid and o1.equals(o2). Returns -1 if o1 is before o2 in the file, or o1 has no valid position or both positions are invalid !o1.equals(o2). Returns 1 if o2 is after o1 in the file, or o2 has no valid position.
      Specified by:
      compare in interface Comparator<CtElement>