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
_calculatedRandom
protected java.lang.String
_comment
protected int
_count
protected Location
_destination
protected int
_hits
protected java.lang.String
_id
protected java.lang.String
_load
protected java.lang.String
_pickupTrainScheduleId
protected java.lang.String
_random
protected java.lang.String
_road
protected int
_sequenceId
protected java.lang.String
_setoutTrainScheduleId
protected java.lang.String
_ship
protected Track
_trackDestination
protected java.lang.String
_type
protected int
_wait
static java.lang.String
COUNT_CHANGED_PROPERTY
static java.lang.String
DESTINATION_CHANGED_PROPERTY
static java.lang.String
DESTINATION_TRACK_CHANGED_PROPERTY
static java.lang.String
DISPOSE
static java.lang.String
HITS_CHANGED_PROPERTY
static java.lang.String
LOAD_CHANGED_PROPERTY
static java.lang.String
NONE
static java.lang.String
ROAD_CHANGED_PROPERTY
static java.lang.String
TRAIN_SCHEDULE_CHANGED_PROPERTY
static java.lang.String
TYPE_CHANGED_PROPERTY
static java.lang.String
WAIT_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 void
copyScheduleItem(ScheduleItem si)
void
dispose()
boolean
doRandom()
Method determines by random if a car is accepted by a scheduleItemdouble
getCalculatedRandom()
java.lang.String
getComment()
int
getCount()
How many times a car type needs to use the schedule item before going to the next item in the schedule.Location
getDestination()
java.lang.String
getDestinationId()
java.lang.String
getDestinationName()
Track
getDestinationTrack()
java.lang.String
getDestinationTrackId()
java.lang.String
getDestinationTrackName()
int
getHits()
java.lang.String
getId()
java.lang.String
getPickupTrainScheduleId()
java.lang.String
getPickupTrainScheduleName()
java.lang.String
getRandom()
java.lang.String
getReceiveLoadName()
java.lang.String
getRoadName()
int
getSequenceId()
java.lang.String
getSetoutTrainScheduleId()
java.lang.String
getSetoutTrainScheduleName()
java.lang.String
getShipLoadName()
java.lang.String
getTypeName()
int
getWait()
void
propertyChange(java.beans.PropertyChangeEvent e)
void
setComment(java.lang.String comment)
void
setCount(int count)
void
setDestination(Location destination)
void
setDestinationTrack(Track track)
void
setHits(int hit)
void
setPickupTrainScheduleId(java.lang.String id)
void
setRandom(java.lang.String value)
void
setReceiveLoadName(java.lang.String load)
Sets the car load requested.void
setRoadName(java.lang.String road)
Sets the requested car road name.void
setSequenceId(int sequence)
void
setSetoutTrainScheduleId(java.lang.String id)
void
setShipLoadName(java.lang.String load)
Sets the car load that will ship.void
setTypeName(java.lang.String type)
Sets the type of car requested.void
setWait(int wait)
org.jdom2.Element
store()
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:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-