Class ScheduleItem
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.locations.schedules.ScheduleItem
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener,PropertyChangeFirer,PropertyChangeProvider
public class ScheduleItem extends PropertyChangeSupport implements java.beans.PropertyChangeListener
Represents one schedule item of a schedule
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double_calculatedRandomprotected java.lang.String_commentprotected int_countprotected Location_destinationprotected int_hitsprotected java.lang.String_idprotected java.lang.String_loadprotected java.lang.String_pickupTrainScheduleIdprotected java.lang.String_randomprotected java.lang.String_roadprotected int_sequenceIdprotected java.lang.String_setoutTrainScheduleIdprotected java.lang.String_shipprotected Track_trackDestinationprotected java.lang.String_typeprotected int_waitstatic java.lang.StringCOUNT_CHANGED_PROPERTYstatic java.lang.StringDESTINATION_CHANGED_PROPERTYstatic java.lang.StringDESTINATION_TRACK_CHANGED_PROPERTYstatic java.lang.StringDISPOSEstatic java.lang.StringHITS_CHANGED_PROPERTYstatic java.lang.StringLOAD_CHANGED_PROPERTYstatic java.lang.StringNONEstatic java.lang.StringROAD_CHANGED_PROPERTYstatic java.lang.StringTRAIN_SCHEDULE_CHANGED_PROPERTYstatic java.lang.StringTYPE_CHANGED_PROPERTYstatic java.lang.StringWAIT_CHANGED_PROPERTY-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description ScheduleItem(java.lang.String id, java.lang.String type)ScheduleItem(org.jdom2.Element e)Construct this Entry from XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyScheduleItem(ScheduleItem si)voiddispose()booleandoRandom()Method determines by random if a car is accepted by a scheduleItemdoublegetCalculatedRandom()java.lang.StringgetComment()intgetCount()How many times a car type needs to use the schedule item before going to the next item in the schedule.LocationgetDestination()java.lang.StringgetDestinationId()java.lang.StringgetDestinationName()TrackgetDestinationTrack()java.lang.StringgetDestinationTrackId()java.lang.StringgetDestinationTrackName()intgetHits()java.lang.StringgetId()java.lang.StringgetPickupTrainScheduleId()java.lang.StringgetPickupTrainScheduleName()java.lang.StringgetRandom()java.lang.StringgetReceiveLoadName()java.lang.StringgetRoadName()intgetSequenceId()java.lang.StringgetSetoutTrainScheduleId()java.lang.StringgetSetoutTrainScheduleName()java.lang.StringgetShipLoadName()java.lang.StringgetTypeName()intgetWait()voidpropertyChange(java.beans.PropertyChangeEvent e)voidsetComment(java.lang.String comment)voidsetCount(int count)voidsetDestination(Location destination)voidsetDestinationTrack(Track track)voidsetHits(int hit)voidsetPickupTrainScheduleId(java.lang.String id)voidsetRandom(java.lang.String value)voidsetReceiveLoadName(java.lang.String load)Sets the car load requested.voidsetRoadName(java.lang.String road)Sets the requested car road name.voidsetSequenceId(int sequence)voidsetSetoutTrainScheduleId(java.lang.String id)voidsetShipLoadName(java.lang.String load)Sets the car load that will ship.voidsetTypeName(java.lang.String type)Sets the type of car requested.voidsetWait(int wait)org.jdom2.Elementstore()Create an XML element to represent this Entry.-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
_id
protected java.lang.String _id
-
_sequenceId
protected int _sequenceId
-
_random
protected java.lang.String _random
-
_setoutTrainScheduleId
protected java.lang.String _setoutTrainScheduleId
-
_type
protected java.lang.String _type
-
_road
protected java.lang.String _road
-
_load
protected java.lang.String _load
-
_ship
protected java.lang.String _ship
-
_destination
protected Location _destination
-
_trackDestination
protected Track _trackDestination
-
_pickupTrainScheduleId
protected java.lang.String _pickupTrainScheduleId
-
_count
protected int _count
-
_wait
protected int _wait
-
_hits
protected int _hits
-
_comment
protected java.lang.String _comment
-
TRAIN_SCHEDULE_CHANGED_PROPERTY
public static final java.lang.String TRAIN_SCHEDULE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
COUNT_CHANGED_PROPERTY
public static final java.lang.String COUNT_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TYPE_CHANGED_PROPERTY
public static final java.lang.String TYPE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
ROAD_CHANGED_PROPERTY
public static final java.lang.String ROAD_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LOAD_CHANGED_PROPERTY
public static final java.lang.String LOAD_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DESTINATION_CHANGED_PROPERTY
public static final java.lang.String DESTINATION_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DESTINATION_TRACK_CHANGED_PROPERTY
public static final java.lang.String DESTINATION_TRACK_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
WAIT_CHANGED_PROPERTY
public static final java.lang.String WAIT_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
HITS_CHANGED_PROPERTY
public static final java.lang.String HITS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DISPOSE
public static final java.lang.String DISPOSE
- See Also:
- Constant Field Values
-
_calculatedRandom
double _calculatedRandom
-
-
Constructor Detail
-
ScheduleItem
public ScheduleItem(java.lang.String id, java.lang.String type)
- Parameters:
id- ScheduleItem string idtype- car type for schedule
-
ScheduleItem
public ScheduleItem(org.jdom2.Element e)
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 Detail
-
getId
public java.lang.String getId()
-
getTypeName
public java.lang.String getTypeName()
-
setTypeName
public void setTypeName(java.lang.String type)
Sets the type of car requested.- Parameters:
type- The car type requested.
-
getRandom
public java.lang.String getRandom()
-
setRandom
public void setRandom(java.lang.String value)
-
doRandom
public boolean doRandom()
Method determines by random if a car is accepted by a scheduleItem- Returns:
- true if car is accepted by the scheduleItem
-
getCalculatedRandom
public double getCalculatedRandom()
-
getSetoutTrainScheduleId
public java.lang.String getSetoutTrainScheduleId()
-
getSetoutTrainScheduleName
public java.lang.String getSetoutTrainScheduleName()
-
setSetoutTrainScheduleId
public void setSetoutTrainScheduleId(java.lang.String id)
-
getPickupTrainScheduleId
public java.lang.String getPickupTrainScheduleId()
-
getPickupTrainScheduleName
public java.lang.String getPickupTrainScheduleName()
-
setPickupTrainScheduleId
public void setPickupTrainScheduleId(java.lang.String id)
-
getRoadName
public java.lang.String getRoadName()
-
setRoadName
public void setRoadName(java.lang.String road)
Sets the requested car road name.- Parameters:
road- The car road requested.
-
setReceiveLoadName
public void setReceiveLoadName(java.lang.String load)
Sets the car load requested.- Parameters:
load- The load name requested.
-
getReceiveLoadName
public java.lang.String getReceiveLoadName()
-
setShipLoadName
public void setShipLoadName(java.lang.String load)
Sets the car load that will ship.- Parameters:
load- The car load shipped.
-
getShipLoadName
public java.lang.String getShipLoadName()
-
getSequenceId
public int getSequenceId()
-
setSequenceId
public void setSequenceId(int sequence)
-
getCount
public int getCount()
How many times a car type needs to use the schedule item before going to the next item in the schedule. Used in sequential mode. Default is one.- Returns:
- the number of times a car type needs to use the schedule item
-
setCount
public void setCount(int count)
-
getWait
public int getWait()
-
setWait
public void setWait(int wait)
-
getHits
public int getHits()
-
setHits
public void setHits(int hit)
-
getDestination
public Location getDestination()
-
setDestination
public void setDestination(Location destination)
-
getDestinationName
public java.lang.String getDestinationName()
-
getDestinationId
public java.lang.String getDestinationId()
-
getDestinationTrack
public Track getDestinationTrack()
-
setDestinationTrack
public void setDestinationTrack(Track track)
-
getDestinationTrackName
public java.lang.String getDestinationTrackName()
-
getDestinationTrackId
public java.lang.String getDestinationTrackId()
-
setComment
public void setComment(java.lang.String comment)
-
getComment
public java.lang.String getComment()
-
copyScheduleItem
public void copyScheduleItem(ScheduleItem si)
-
dispose
public void dispose()
-
store
public org.jdom2.Element 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
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
-