Package jmri.jmrit.etcs
Class TrackSection
java.lang.Object
jmri.jmrit.etcs.TrackSection
Class to represent DMI Track Points of Interest,
i.e. Announcements and Orders.
-
Constructor Summary
ConstructorsConstructorDescriptionTrackSection(int sectionLength, int sectionSpeed, int sectionGradient) Create a new TrackSection. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an Announcement to the Track Section.protected voidadvanceAnnouncements(int distance) Get the List of Announcements for the Section.intGet the Section Gradient.intGet the Section Length.intgetSpeed()Get the maximum speed for Section.protected voidsetLength(int newLength) toString()
-
Constructor Details
-
TrackSection
Create a new TrackSection.- Parameters:
sectionLength- the Section Length.sectionSpeed- the Section Speed.sectionGradient- the Section Gradient.
-
-
Method Details
-
getLength
Get the Section Length.- Returns:
- section length.
-
setLength
-
getSpeed
Get the maximum speed for Section.- Returns:
- maximum speed.
-
getGradient
Get the Section Gradient.- Returns:
- gradient percentage for the Track Section.
-
addAnnouncement
Add an Announcement to the Track Section.- Parameters:
ac- the Announcement to add.- Throws:
IllegalArgumentException- if the Announcement does not fit into the TrackSection.
-
getAnnouncements
Get the List of Announcements for the Section.- Returns:
- List of Announcements related to the TrackSection.
-
advanceAnnouncements
-
toString
-