Class TypeComparator

java.lang.Object
EDU.purdue.cs.bloat.editor.TypeComparator
All Implemented Interfaces:
Comparator

public final class TypeComparator extends Object implements Comparator
A TypeComparator orders Types such that a subclass preceededs its superclass. Note that this doesn't really work with interfaces.
  • Field Details

    • DEBUG

      public static boolean DEBUG
  • Constructor Details

    • TypeComparator

      public TypeComparator(EditorContext context)
      Constructor.
  • Method Details

    • compare

      public int compare(Object o1, Object o2)
      Returns a negative value if o1 invalid input: '<' o2 (t1 is a subclass of t2). Otherwise, it returns a positive value.
      Specified by:
      compare in interface Comparator
    • equals

      public boolean equals(Object other)
      Indicates whether some other object is "equal to" this Comparator.
      Specified by:
      equals in interface Comparator
      Overrides:
      equals in class Object