Package jmri.util

Class NamedBeanHandleComparator<H extends NamedBeanHandle<? extends NamedBean>>

  • Type Parameters:
    H - NamedBeanHandle of a supported type of NamedBean
    All Implemented Interfaces:
    java.util.Comparator<H>

    public class NamedBeanHandleComparator<H extends NamedBeanHandle<? extends NamedBean>>
    extends java.lang.Object
    implements java.util.Comparator<H>
    Comparator for JMRI NamedBeanHandle of NamedBeans via their System Names.

    Uses the built-in Comparable interface of the named beans.

    Note that unlike the NamedBean itself, the sytem name of a NamedBean within a particular NamedBeanHandle is not immutable. The handle can point at a different NamedBean after a rename operation.

    See Also:
    NamedBean, NamedBeanHandle, NamedBeanHandleManager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(H n1, H n2)  
      • 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