com.isti.trinetwatch.station
Class StationNameComp

java.lang.Object
  extended by com.isti.trinetwatch.station.StationNameComp
All Implemented Interfaces:
java.util.Comparator

public class StationNameComp
extends java.lang.Object
implements java.util.Comparator

Class StationNameComp implements a comparator that compares two station name strings, using any leading network code ('NN-') as a secondary comparison value.


Constructor Summary
StationNameComp()
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          Compares the two objects for order, returning a negative integer, zero, or a positive integer as the first object is less than, equal, or greater than the second object.
 
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

StationNameComp

public StationNameComp()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
Compares the two objects for order, returning a negative integer, zero, or a positive integer as the first object is less than, equal, or greater than the second object. Both objects must be strings, and the network code prefix (i.e. "CI-") is used as a secondary comparison value.

Specified by:
compare in interface java.util.Comparator
Throws:
java.lang.ClassCastException - if either object is not of type 'String'.