Class Station

java.lang.Object
jmri.jmrit.timetable.Station

public class Station extends Object
Define the content of a Station record.
  • Field Details

  • Constructor Details

    • Station

      public Station(int segmentId)
      Create a new station with default values.
      Parameters:
      segmentId - The parent segment id.
      Throws:
      IllegalArgumentException - STATION_ADD_FAIL
    • Station

      public Station(int stationId, int segmentId, String stationName, double distance, boolean doubleTrack, int sidings, int staging)
  • Method Details

    • 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

    • setStationName

      public void setStationName(String newName)
    • getDistance

      public double getDistance()
    • setDistance

      public void setDistance(double newDistance)
      Set a new distance.
      Parameters:
      newDistance - The value to be used.
      Throws:
      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:
      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:
      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 String toString()
      Overrides:
      toString in class Object