Changeset 353 in tmcsimulator for trunk/src/atmsdriver/model/Highway.java


Ignore:
Timestamp:
04/02/2019 06:30:15 PM (7 years ago)
Author:
jdalbey
Message:

StationComparator?.java added to json output can be ordered by route then postmile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/model/Highway.java

    r343 r353  
    1616 * @author jdalbey 
    1717 */ 
    18 final public class Highway 
     18final public class Highway implements Comparable<Highway> 
    1919{ 
    2020    /** The identifying number for this highway, e.g., 101 */ 
     
    4949        return Integer.toString(this.routeNumber); 
    5050    } 
     51 
     52    @Override 
     53    public int compareTo(Highway other) 
     54    { 
     55        int otherRoute = ((Highway) other).routeNumber;  
     56        //ascending order 
     57        return this.routeNumber - otherRoute;         
     58    } 
    5159} 
Note: See TracChangeset for help on using the changeset viewer.