Package jmri.jmrit.timetable
Class Station
- java.lang.Object
-
- jmri.jmrit.timetable.Station
-
public class Station extends java.lang.Object
Define the content of a Station record.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TimeTableDataManager
_dm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Station
getCopy(int segmentId)
Make a copy of the station.double
getDistance()
boolean
getDoubleTrack()
int
getSegmentId()
int
getSidings()
int
getStaging()
int
getStationId()
java.lang.String
getStationName()
void
setDistance(double newDistance)
Set a new distance.void
setDoubleTrack(boolean newDoubleTrack)
void
setSidings(int newSidings)
Set a new siding count.void
setStaging(int newStaging)
Set a new staging track count.void
setStationName(java.lang.String newName)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Station
public Station(int segmentId)
Create a new station with default values.- Parameters:
segmentId
- The parent segment id.- Throws:
java.lang.IllegalArgumentException
- STATION_ADD_FAIL
-
Station
public Station(int stationId, int segmentId, java.lang.String stationName, double distance, boolean doubleTrack, int sidings, int staging)
-
-
Method Detail
-
getCopy
public Station getCopy(int segmentId)
Make a copy of the station.- Parameters:
segmentId
- The new segmentId, if zero use the current segment id.- Returns:
- a new station instance.
-
getStationId
public int getStationId()
-
getSegmentId
public int getSegmentId()
-
getStationName
public java.lang.String getStationName()
-
setStationName
public void setStationName(java.lang.String newName)
-
getDistance
public double getDistance()
-
setDistance
public void setDistance(double newDistance)
Set a new distance.- Parameters:
newDistance
- The value to be used.- Throws:
java.lang.IllegalArgumentException
- (DISTANCE_LT_0) if the value is less than 0.0.
-
getDoubleTrack
public boolean getDoubleTrack()
-
setDoubleTrack
public void setDoubleTrack(boolean newDoubleTrack)
-
getSidings
public int getSidings()
-
setSidings
public void setSidings(int newSidings)
Set a new siding count.- Parameters:
newSidings
- The value to be used.- Throws:
java.lang.IllegalArgumentException
- (SIDINGS_LT_0) if the value is less than 0.
-
getStaging
public int getStaging()
-
setStaging
public void setStaging(int newStaging)
Set a new staging track count.- Parameters:
newStaging
- The value to be used.- Throws:
java.lang.IllegalArgumentException
- (STAGING_LT_0, STAGING_IN_USE) if the value is less than 0 or a staging track is referenced by a train stop.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-