Package EDU.purdue.cs.bloat.editor
Class TypeComparator
- java.lang.Object
-
- EDU.purdue.cs.bloat.editor.TypeComparator
-
- All Implemented Interfaces:
java.util.Comparator
public final class TypeComparator extends java.lang.Object implements java.util.ComparatorA TypeComparator orders Types such that a subclass preceededs its superclass. Note that this doesn't really work with interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEBUG
-
Constructor Summary
Constructors Constructor Description TypeComparator(EditorContext context)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(java.lang.Object o1, java.lang.Object o2)Returns a negative value if o1 < o2 (t1 is a subclass of t2).booleanequals(java.lang.Object other)Indicates whether some other object is "equal to" this Comparator.
-
-
-
Constructor Detail
-
TypeComparator
public TypeComparator(EditorContext context)
Constructor.
-
-
Method Detail
-
compare
public int compare(java.lang.Object o1, java.lang.Object o2)Returns a negative value if o1 < o2 (t1 is a subclass of t2). Otherwise, it returns a positive value.- Specified by:
comparein interfacejava.util.Comparator
-
equals
public boolean equals(java.lang.Object other)
Indicates whether some other object is "equal to" this Comparator.- Specified by:
equalsin interfacejava.util.Comparator- Overrides:
equalsin classjava.lang.Object
-
-