Class Schedule
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.locations.schedules.Schedule
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider
Represents a car delivery schedule for a location
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected intprotected Stringprotected Hashtable<String,ScheduleItem> protected intstatic final Stringstatic final Stringstatic final StringFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a car type to the end of this scheduleAdd a schedule item at a specific place (sequence) in the schedule Allowable sequence numbers are 0 to max size of schedule. 0 = start of list.booleancheckScheduleAttribute(String attribute, String carType, Car car) checkScheduleItem(ScheduleItem si, Car car, Track track, boolean isRandomChecked) checkScheduleItemValid(ScheduleItem si, Track track) checkScheduleValid(Track track) Check to see if schedule is valid for the track.voidDelete a ScheduleItemvoiddispose()getId()getItemById(String id) Get a ScheduleItem by idgetItemBySequenceId(int sequenceId) getItemByType(String carType) Get item by car type (gets last schedule item with this type)Get a list of ScheduleItems sorted by schedule ordergetName()intgetSize()booleanvoidPlaces a ScheduleItem later in the schedulevoidPlaces a ScheduleItem earlier in the schedulevoidvoidregister(ScheduleItem si) Remember a NamedBean Object created outside the manager.voidsearchSchedule(Car car, Track track) voidsetComment(String comment) protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidorg.jdom2.Elementstore()Create an XML element to represent this Entry.toString()Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
_id
-
_name
-
_comment
-
_scheduleHashTable
-
_IdNumber
-
_sequenceNum
-
LISTCHANGE_CHANGED_PROPERTY
- See Also:
-
DISPOSE
- See Also:
-
SCHEDULE_OKAY
- See Also:
-
-
Constructor Details
-
Schedule
-
Schedule
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-config.xml- Parameters:
e- Consist XML element
-
-
Method Details
-
getId
-
setName
-
toString
-
getName
-
getSize
-
setComment
-
getComment
-
dispose
-
resetHitCounts
-
hasRandomItem
-
addItem
Adds a car type to the end of this schedule- Parameters:
type- The string car type to add.- Returns:
- ScheduleItem created for the car type added
-
addItem
Add a schedule item at a specific place (sequence) in the schedule Allowable sequence numbers are 0 to max size of schedule. 0 = start of list.- Parameters:
carType- The string car type name to add.sequence- Where in the schedule to add the item.- Returns:
- schedule item
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
si- The schedule item to add.
-
deleteItem
Delete a ScheduleItem- Parameters:
si- The scheduleItem to delete.
-
getItemByType
Get item by car type (gets last schedule item with this type)- Parameters:
carType- The string car type to search for.- Returns:
- schedule item
-
getItemById
Get a ScheduleItem by id- Parameters:
id- The string id of the ScheduleItem.- Returns:
- schedule item
-
getItemsBySequenceList
Get a list of ScheduleItems sorted by schedule order- Returns:
- list of ScheduleItems ordered by sequence
-
moveItemUp
Places a ScheduleItem earlier in the schedule- Parameters:
si- The ScheduleItem to move.
-
moveItemDown
Places a ScheduleItem later in the schedule- Parameters:
si- The ScheduleItem to move.
-
getItemBySequenceId
-
checkScheduleValid
Check to see if schedule is valid for the track.- Parameters:
track- The track associated with this schedule- Returns:
- SCHEDULE_OKAY if schedule okay, otherwise an error message.
-
checkScheduleItemValid
-
searchSchedule
-
checkScheduleItem
-
checkScheduleAttribute
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-config.xml.- Returns:
- Contents in a JDOM Element
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
setDirtyAndFirePropertyChange
-