Package jmri.jmrit.etcs
Class TrackSection
- java.lang.Object
-
- jmri.jmrit.etcs.TrackSection
-
@API(status=EXPERIMENTAL) public class TrackSection extends java.lang.Object
Class to represent DMI Track Points of Interest, i.e. Announcements and Orders.
-
-
Constructor Summary
Constructors Constructor Description TrackSection(int sectionLength, int sectionSpeed, int sectionGradient)
Create a new TrackSection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnouncement(TrackCondition ac)
Add an Announcement to the Track Section.protected void
advanceAnnouncements(int distance)
java.util.List<TrackCondition>
getAnnouncements()
Get the List of Announcements for the Section.int
getGradient()
Get the Section Gradient.int
getLength()
Get the Section Length.int
getSpeed()
Get the maximum speed for Section.protected void
setLength(int newLength)
java.lang.String
toString()
-
-
-
Constructor Detail
-
TrackSection
public TrackSection(int sectionLength, int sectionSpeed, int sectionGradient)
Create a new TrackSection.- Parameters:
sectionLength
- the Section Length.sectionSpeed
- the Section Speed.sectionGradient
- the Section Gradient.
-
-
Method Detail
-
getLength
public int getLength()
Get the Section Length.- Returns:
- section length.
-
setLength
protected void setLength(int newLength)
-
getSpeed
public int getSpeed()
Get the maximum speed for Section.- Returns:
- maximum speed.
-
getGradient
public int getGradient()
Get the Section Gradient.- Returns:
- gradient percentage for the Track Section.
-
addAnnouncement
public void addAnnouncement(@Nonnull TrackCondition ac)
Add an Announcement to the Track Section.- Parameters:
ac
- the Announcement to add.- Throws:
java.lang.IllegalArgumentException
- if the Announcement does not fit into the TrackSection.
-
getAnnouncements
public java.util.List<TrackCondition> getAnnouncements()
Get the List of Announcements for the Section.- Returns:
- List of Announcements related to the TrackSection.
-
advanceAnnouncements
protected void advanceAnnouncements(int distance)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-