jmri.util
Class NamedBeanComparator

java.lang.Object
  extended by jmri.util.SystemNameComparator
      extended by jmri.util.NamedBeanComparator
All Implemented Interfaces:
Serializable, Comparator<Object>

public class NamedBeanComparator
extends SystemNameComparator

Comparator for JMRI System Names.

A System Name is two letters followed by either an alpha name or a number. In the number case, this does a numeric comparison. If the number is appended with letters, does the numeric sort on the digits followed by a lexigraphic sort on the remainder.

Author:
Pete Cressman Copyright (C) 2009
See Also:
Serialized Form

Constructor Summary
NamedBeanComparator()
           
 
Method Summary
 int compare(Object nb1, Object nb2)
           
 
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
 

Constructor Detail

NamedBeanComparator

public NamedBeanComparator()
Method Detail

compare

public int compare(Object nb1,
                   Object nb2)
Specified by:
compare in interface Comparator<Object>
Overrides:
compare in class SystemNameComparator


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads