Class Pool

    • Constructor Detail

      • Pool

        public Pool​(java.lang.String id,
                    java.lang.String name)
    • Method Detail

      • getId

        public java.lang.String getId()
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getSize

        public int getSize()
        The number of tracks in this pool.
        Returns:
        the number of tracks in this pool.
      • toString

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

        public void add​(Track track)
        Adds a track to this pool
        Parameters:
        track - to be added.
      • remove

        public void remove​(Track track)
        Removes a track from this pool
        Parameters:
        track - to be removed.
      • requestTrackLength

        public boolean requestTrackLength​(Track track,
                                          int length)
        Request track length from one of the other tracks in this pool. Other tracks in the same pool may have their length shortened or lengthened by this operation.
        Parameters:
        track - the track requesting additional length
        length - the length of rolling stock
        Returns:
        true if successful