Class NamedHandleObjectComparator

  • All Implemented Interfaces:
    java.util.Comparator

    public class NamedHandleObjectComparator
    extends java.lang.Object
    implements java.util.Comparator
    Comparator for instances of NamedHandleObject for display to an end user. The comparison is based on the name of the instances.
    Since:
    3.2
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object left, java.lang.Object right)
      Compares to instances of NamedHandleObject based on their names.
      • 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

      • NamedHandleObjectComparator

        public NamedHandleObjectComparator()
    • Method Detail

      • compare

        public final int compare​(java.lang.Object left,
                                 java.lang.Object right)
        Compares to instances of NamedHandleObject based on their names. This is useful is they are display to an end user.
        Specified by:
        compare in interface java.util.Comparator
        Parameters:
        left - The first obect to compare; may be null.
        right - The second object to compare; may be null.
        Returns:
        -1 if left is null and right is not null; 0 if they are both null; 1 if left is not null and right is null. Otherwise, the result of left.compareTo(right).