- java.lang.Object
-
- jmri.util.NamedBeanComparator<B>
-
- jmri.util.NamedBeanPreferNumericComparator<B>
-
- Type Parameters:
B- the type of NamedBean to compare
- All Implemented Interfaces:
java.util.Comparator<B>
public class NamedBeanPreferNumericComparator<B extends NamedBean> extends NamedBeanComparator<B>
Compare two NamedBeans using thePreferNumericComparatoragainstNamedBean.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), useNamedBeanComparator, 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 beIT3, IT4, IT5, IT42, IT0042, IT50), use this Comparator.
-
-
Constructor Summary
Constructors Constructor Description NamedBeanPreferNumericComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(B n1, B n2)
-
-
-
Constructor Detail
-
NamedBeanPreferNumericComparator
public NamedBeanPreferNumericComparator()
-
-