java.lang.Object
jmri.util.NamedBeanComparator<B>
- Type Parameters:
B- supported type of NamedBean
- All Implemented Interfaces:
Comparator<B>
- Direct Known Subclasses:
NamedBeanPreferNumericComparator
Comparator for JMRI NamedBeans via their System Names.
Uses the built-in Comparable interface of the named beans.
A System Name is a system prefix followed by type letter then a suffix with a
system-specific format. This class first compares on prefix, then if the
prefixes are equal it compares the type letter, then if they're still equal
it does an AlphanumComparator compare on suffix.
This sorts on the information in the NamedBean itself, including using the actual type by deferring prefix comparison into the specific NamedBean subclass. This is different from the (deprecated) SystemNameComparator, which only does a common lexical sort. See the Names documentation page.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
NamedBeanComparator
public NamedBeanComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<B extends NamedBean>
-