jmri.util
Class SystemNameComparator

java.lang.Object
  extended by jmri.util.SystemNameComparator
All Implemented Interfaces:
Serializable, Comparator<Object>
Direct Known Subclasses:
LRouteTableAction.RouteElementComparator, NamedBeanComparator

public class SystemNameComparator
extends Object
implements Comparator<Object>, Serializable

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:
Bob Jacobsen Copyright (C) 2004, Howard Penny, Pete Cressman
See Also:
Serialized Form

Constructor Summary
SystemNameComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
           
 
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

SystemNameComparator

public SystemNameComparator()
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator<Object>


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