java.lang.Object
jmri.util.NamedBeanComparator<B>
jmri.util.NamedBeanPreferNumericComparator<B>
- Type Parameters:
B- the type of NamedBean to compare
- All Implemented Interfaces:
Comparator<B>
Compare two NamedBeans using the
PreferNumericComparator against
NamedBean.getSystemName() for each NamedBean.
If the requirement is that Comparator.compare(Object, Object) return
0 for two numerically identical NamedBean System Names (i.e.
IT42 == IT0042), use NamedBeanComparator, but if the
requirement is that System Names should be numerically ordered, but that
non-identical representations of numbers should be different, (i.e.
IT42 != IT0042, but order should be
IT3, IT4, IT5, IT42, IT0042, IT50), use this Comparator.
-
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
-
NamedBeanPreferNumericComparator
public NamedBeanPreferNumericComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<B extends NamedBean>- Overrides:
comparein classNamedBeanComparator<B extends NamedBean>
-