Class BasicStorable.IdComparator<T extends Storable>

  • Type Parameters:
    T - subclasse of Storable
    All Implemented Interfaces:
    java.util.Comparator<T>
    Enclosing class:
    BasicStorable

    public static class BasicStorable.IdComparator<T extends Storable>
    extends java.lang.Object
    implements java.util.Comparator<T>
    Compares two Storables using their ID. Note: this comparator imposes orderings that are inconsistent with equals.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdComparator()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(T s1, T s2)  
      static int compareStorableId​(Storable s1, Storable s2)
      Compare two storable using their ID.
      • Methods inherited from class java.lang.Object

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

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • IdComparator

        public IdComparator()
    • Method Detail

      • compare

        public int compare​(T s1,
                           T s2)
        Specified by:
        compare in interface java.util.Comparator<T extends Storable>
      • compareStorableId

        public static int compareStorableId​(Storable s1,
                                            Storable s2)
        Compare two storable using their ID.
        Parameters:
        s1 - the first storable to compare
        s2 - the second storable to compare
        Returns:
        a int to compare this two storables