Class Pool

java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.jmrit.operations.locations.Pool
All Implemented Interfaces:
BeanInterface, PropertyChangeFirer, PropertyChangeProvider

public class Pool extends Bean
Represents a pool of tracks that share their length.
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public String getId()
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getSize

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

      public String toString()
      Overrides:
      toString in class Object
    • dispose

      public void dispose()
    • 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.
    • getTracks

      public List<Track> getTracks()
    • getTotalLengthTracks

      public int getTotalLengthTracks()
    • getMaxLengthTrack

      public int getMaxLengthTrack(Track track)
      Used to determine the maximum available length for a given track
      Parameters:
      track - the track being evaluated
      Returns:
      maximum track length
    • 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
    • isMaxLengthOptionEnabled

      public boolean isMaxLengthOptionEnabled()
      Used to determine if the option to use maximum track length in a pool is enabled. Enabled when there's 3 or more tracks in the pool.
      Returns:
      true if maximum track length option is available
    • isThereMaxLengthRestrictions

      public boolean isThereMaxLengthRestrictions()