Class 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 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<TrackConditiongetAnnouncements()
        Get the List of Announcements for the Section.
        Returns:
        List of Announcements related to the TrackSection.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object