Class TypeComparator

  • All Implemented Interfaces:
    java.util.Comparator

    public final class TypeComparator
    extends java.lang.Object
    implements java.util.Comparator
    A 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 boolean DEBUG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object o1, java.lang.Object o2)
      Returns a negative value if o1 < o2 (t1 is a subclass of t2).
      boolean equals​(java.lang.Object other)
      Indicates whether some other object is "equal to" this Comparator.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Field Detail

      • DEBUG

        public static boolean DEBUG
    • 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:
        compare in interface java.util.Comparator
      • equals

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