Changeset 93 in tmcsimulator for trunk/src/atmsdriver


Ignore:
Timestamp:
10/11/2017 12:35:22 PM (9 years ago)
Author:
jdalbey
Message:

Highway.java: Removed direction and made immutable

File:
1 edited

Legend:

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

    r89 r93  
    11package atmsdriver.model; 
    22 
    3 import atmsdriver.model.Station.DIRECTION; 
    43import java.util.ArrayList; 
    5 import java.util.Collections; 
    64 
    75/** 
     6 * Highway represents a freeway that has two directions of traffic. A highway is 
     7 * identified by its highway number.  A highway contains lane detector stations, 
     8 * called Stations, along its length. 
    89 * 
    9  * @author jtorres 
     10 * @author jdalbey 
    1011 */ 
    11 class Highway { 
    12      
    13     final private ArrayList<Station> stations; 
    14     final private Integer highwayNumber; 
    15     final private DIRECTION direction; 
    16      
    17     public Highway(Integer highwayNum, DIRECTION direction, ArrayList<Station> stations) 
     12final class Highway 
     13{ 
     14    /** The identifying number for this highway, e.g., 101 */ 
     15    public final Integer highwayNumber; 
     16    /** The ordered list of stations (lane detector stations) on this highway */ 
     17    public final ArrayList<Station> stations; 
     18 
     19    /** Construct a highway  
     20     *  
     21     * @param highwayNum integer identifier for this highway 
     22     * @param stations ordered list of stations on this highway 
     23     */ 
     24    public Highway(Integer highwayNum, ArrayList<Station> stations) 
    1825    { 
    1926        this.highwayNumber = highwayNum; 
    20         this.direction = direction; 
    2127        this.stations = stations; 
    2228    } 
    23      
    24     public Integer getRouteNumber() 
    25     { 
    26         return this.highwayNumber; 
    27     } 
    28      
    29     public DIRECTION getDirection() 
    30     { 
    31         return this.direction; 
    32     } 
    33      
    34     public ArrayList<Station> getStations() 
    35     { 
    36         return this.stations; 
    37     } 
    3829} 
Note: See TracChangeset for help on using the changeset viewer.