Package jmri.jmrit.operations.locations
Class Pool
java.lang.Object
jmri.beans.UnboundBean
jmri.beans.Bean
jmri.jmrit.operations.locations.Pool
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider
Represents a pool of tracks that share their length.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringstatic final Stringstatic final StringFields inherited from class jmri.beans.Bean
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a track to this poolvoiddispose()getId()intgetMaxLengthTrack(Track track) Used to determine the maximum available length for a given trackgetName()intgetSize()The number of tracks in this pool.intbooleanUsed to determine if the option to use maximum track length in a pool is enabled.booleanvoidRemoves a track from this poolbooleanrequestTrackLength(Track track, int length) Request track length from one of the other tracks in this pool.voidtoString()Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Field Details
-
LISTCHANGE_CHANGED_PROPERTY
- See Also:
-
DISPOSE
- See Also:
-
_tracks
-
_id
-
_name
-
-
Constructor Details
-
Pool
-
-
Method Details
-
getId
-
getName
-
setName
-
getSize
The number of tracks in this pool.- Returns:
- the number of tracks in this pool.
-
toString
-
dispose
-
add
Adds a track to this pool- Parameters:
track- to be added.
-
remove
Removes a track from this pool- Parameters:
track- to be removed.
-
getTracks
-
getTotalLengthTracks
-
getMaxLengthTrack
Used to determine the maximum available length for a given track- Parameters:
track- the track being evaluated- Returns:
- maximum track length
-
requestTrackLength
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 lengthlength- the length of rolling stock- Returns:
- true if successful
-
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
-