Class OrderingCompareAgent<T>


  • public abstract class OrderingCompareAgent<T>
    extends java.lang.Object
    Comparing agent for an ordering. Terminology: the "preferred" item will register as LESS.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T a  
      protected T b  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int compare()  
      protected boolean consider​(int partial)  
      protected abstract void doCompare()  
      protected static int dontCare()  
      protected boolean isUnknown()  
      protected static int preferFalse​(boolean b1, boolean b2)  
      protected static <U> int preferLess​(java.lang.Comparable<U> c1, U c2)  
      protected static <U> int preferLess​(U c1, U c2, java.util.Comparator<U> comp)  
      protected static <U> int preferMore​(java.lang.Comparable<U> c1, U c2)  
      protected static <U> int preferMore​(U c1, U c2, java.util.Comparator<U> comp)  
      protected static int preferTrue​(boolean b1, boolean b2)  
      protected boolean swallowBoolean​(boolean x)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • a

        protected T a
      • b

        protected T b
    • Constructor Detail

      • OrderingCompareAgent

        public OrderingCompareAgent​(T a,
                                    T b)
        Parameters:
        a -
        b -
    • Method Detail

      • doCompare

        protected abstract void doCompare()
      • compare

        public int compare()
        Returns:
        the result
      • isUnknown

        protected boolean isUnknown()
      • consider

        protected boolean consider​(int partial)
      • swallowBoolean

        protected boolean swallowBoolean​(boolean x)
      • dontCare

        protected static int dontCare()
      • preferTrue

        protected static int preferTrue​(boolean b1,
                                        boolean b2)
      • preferFalse

        protected static int preferFalse​(boolean b1,
                                         boolean b2)
      • preferLess

        protected static <U> int preferLess​(java.lang.Comparable<U> c1,
                                            U c2)
      • preferLess

        protected static <U> int preferLess​(U c1,
                                            U c2,
                                            java.util.Comparator<U> comp)
      • preferMore

        protected static <U> int preferMore​(java.lang.Comparable<U> c1,
                                            U c2)
      • preferMore

        protected static <U> int preferMore​(U c1,
                                            U c2,
                                            java.util.Comparator<U> comp)