Class Car
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.rollingstock.RollingStock
jmri.jmrit.operations.rollingstock.cars.Car
- All Implemented Interfaces:
PropertyChangeListener,EventListener,Identifiable,PropertyChangeFirer,PropertyChangeProvider
Represents a car on the layout
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Locationprotected Trackprotected booleanprotected booleanprotected Kernelprotected booleanprotected Stringprotected Stringprotected booleanprotected Stringprotected Locationprotected Trackprotected Stringprotected Stringprotected Locationprotected Trackprotected Stringprotected Locationprotected Trackprotected Stringprotected Stringprotected booleanprotected intstatic final String(package private) CarLoadsstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class jmri.jmrit.operations.rollingstock.RollingStock
_blocking, _built, _clone, _cloneOrder, _color, _comment, _destination, _division, _id, _lastDate, _lastLocationId, _lastTrackId, _lastTrain, _length, _lengthChange, _location, _locationUnknown, _moves, _number, _outOfService, _owner, _pickupTime, _rfid, _road, _routeDestination, _routeId, _routeLocation, _selected, _setoutTime, _tag, _tagListener, _track, _trackDestination, _train, _type, _value, _weight, _weightTons, _whenLastSeen, _whereLastSeen, COMMENT_CHANGED_PROPERTY, COUPLERS, DEFAULT_BLOCKING_ORDER, DEFAULT_WEIGHT, DESTINATION_TRACK_CHANGED_PROPERTY, ERROR_TRACK, FORCE, LENGTH_CHANGED_PROPERTY, LOCATION_UNKNOWN, MAX_BLOCKING_ORDER, NONE, number, ROUTE_DESTINATION_CHANGED_PROPERTY, ROUTE_LOCATION_CHANGED_PROPERTY, TRACK_CHANGED_PROPERTY, TRAIN_CHANGED_PROPERTY, TYPE_CHANGED_PROPERTYFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckDestination(Location destination, Track track) Used to determine if a car can be set out at a destination (location).copy()voiddispose()Remove rolling stock.intReturns a car's weight adjusted for load.The load name assigned to this car.Gets the car's load's priority.Gets the car load's type, empty or load.getScheduleItem(Track track) intReturns the car length or the length of the car's kernel including couplers.intgetWait()booleanhasFred()Used to determine if car has FRED (Flashing Rear End Device).booleanbooleanbooleanbooleanUsed to determine if the car is hazardous or the car's load is hazardous.booleanisLead()Used to determine if car is lead car in a kernelbooleanbooleanUsed to determine if car is performing a local move.booleanprotected booleanUsed to determine is car has been given a Return When Loaded (RWL) address or custom loadbooleanvoidloadCarFinalDestination(ScheduleItem scheduleItem) Called when setting a car's destination to this spur.voidCalled when car is delivered to track.voidvoidreset()voidsetCaboose(boolean caboose) voidsetCarHazardous(boolean hazardous) setDestination(Location destination, Track track) Sets the car's destination on the layoutsetDestination(Location destination, Track track, boolean force) Sets the car's destination on the layoutprotected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidsetFinalDestination(Location destination) Sets the final destination for a car.voidsetFinalDestinationTrack(Track track) voidsetFred(boolean fred) voidA kernel is a group of cars that are switched as a unit.voidsetLoadGeneratedFromStaging(boolean fromStaging) voidsetLoadName(String load) voidsetNextLoadName(String load) Only here for backwards compatibility before version 5.1.4.voidsetPassenger(boolean passenger) voidSets when this car will be picked up (day of the week)voidsetPreviousFinalDestination(Location location) voidvoidvoidsetReturnWhenEmptyDestination(Location destination) voidsetReturnWhenEmptyDestTrack(Track track) voidvoidsetReturnWhenLoadedDestination(Location destination) voidvoidvoidsetRoutePath(String routePath) voidUsed to keep track of which item in a schedule was used for this car.voidsetUtility(boolean utility) voidsetWait(int count) org.jdom2.Elementstore()Create an XML element to represent this Entry.voidUpdates all cars in a kernel.voidupdateLoad(Track track) Updates a car's load when placed at a spur.Methods inherited from class jmri.jmrit.operations.rollingstock.RollingStock
createId, getBlocking, getBuilt, getCloneOrder, getColor, getComment, getDestination, getDestinationId, getDestinationName, getDestinationTrack, getDestinationTrackId, getDestinationTrackName, getDivision, getDivisionId, getDivisionName, getId, getIdTag, getLastDate, getLastLocationId, getLastLocationName, getLastMoveDate, getLastRouteId, getLastTrackId, getLastTrackName, getLastTrain, getLastTrainName, getLength, getLengthInteger, getLocation, getLocationId, getLocationName, getMoves, getNumber, getOwnerName, getPickupTime, getRfid, getRoadName, getRouteDestination, getRouteDestinationId, getRouteLocation, getRouteLocationId, getSetoutTime, getSortDate, getSplitDestinationName, getSplitDestinationTrackName, getSplitLocationName, getSplitTrackName, getStatus, getTotalLength, getTrack, getTrackId, getTrackLastSeen, getTrackLastSeenName, getTrackName, getTrackType, getTrain, getTrainName, getTypeName, getValue, getWeight, getWhenLastSeen, getWhenLastSeenDate, getWhereLastSeen, getWhereLastSeenName, isClone, isLocationUnknown, isOutOfService, isSelected, moveRollingStock, setBlocking, setBuilt, setClone, setCloneOrder, setColor, setComment, setDestination, setDestinationTrack, setDivision, setIdTag, setLastDate, setLastDate, setLastLocationId, setLastRouteId, setLastTrackId, setLastTrain, setLength, setLocation, setLocation, setLocationUnknown, setMoves, setNumber, setOutOfService, setOwnerName, setPickupTime, setRfid, setRoadName, setRouteDestination, setRouteLocation, setSelected, setSetoutTime, setTrack, setTrain, setTypeName, setValue, setWeight, setWeightTons, store, testLocation, toStringMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
carLoads
-
_passenger
-
_hazardous
-
_caboose
-
_fred
-
_utility
-
_loadGeneratedByStaging
-
_kernel
-
_loadName
-
_wait
-
_rweDestination
-
_rweDestTrack
-
_rweLoadName
-
_rwlDestination
-
_rwlDestTrack
-
_rwlLoadName
-
_scheduleId
-
_nextLoadName
-
_finalDestination
-
_finalDestTrack
-
_previousFinalDestination
-
_previousFinalDestTrack
-
_previousScheduleId
-
_pickupScheduleId
-
_routePath
-
EXTENSION_REGEX
- See Also:
-
CABOOSE_EXTENSION
-
FRED_EXTENSION
-
PASSENGER_EXTENSION
-
UTILITY_EXTENSION
-
HAZARDOUS_EXTENSION
-
CLONE
- See Also:
-
CLONE_REGEX
- See Also:
-
LOAD_CHANGED_PROPERTY
- See Also:
-
RWE_LOAD_CHANGED_PROPERTY
- See Also:
-
RWL_LOAD_CHANGED_PROPERTY
- See Also:
-
WAIT_CHANGED_PROPERTY
- See Also:
-
FINAL_DESTINATION_CHANGED_PROPERTY
- See Also:
-
FINAL_DESTINATION_TRACK_CHANGED_PROPERTY
- See Also:
-
RETURN_WHEN_EMPTY_CHANGED_PROPERTY
- See Also:
-
RETURN_WHEN_LOADED_CHANGED_PROPERTY
- See Also:
-
SCHEDULE_ID_CHANGED_PROPERTY
- See Also:
-
KERNEL_NAME_CHANGED_PROPERTY
- See Also:
-
-
Constructor Details
-
Car
public Car() -
Car
-
Car
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-cars.dtd- Parameters:
e- Car XML element
-
-
Method Details
-
copy
-
setCarHazardous
-
isCarHazardous
-
isCarLoadHazardous
-
isHazardous
Used to determine if the car is hazardous or the car's load is hazardous.- Returns:
- true if the car or car's load is hazardous.
-
setPassenger
-
isPassenger
-
setFred
-
hasFred
Used to determine if car has FRED (Flashing Rear End Device).- Returns:
- true if car has FRED.
-
setLoadName
-
getLoadName
The load name assigned to this car.- Returns:
- The load name assigned to this car.
-
setReturnWhenEmptyLoadName
-
getReturnWhenEmptyLoadName
-
setReturnWhenLoadedLoadName
-
getReturnWhenLoadedLoadName
-
getLoadPriority
Gets the car's load's priority.- Returns:
- The car's load priority.
-
getLoadType
Gets the car load's type, empty or load.- Returns:
- type empty or type load
-
getPickupComment
-
getDropComment
-
setLoadGeneratedFromStaging
-
isLoadGeneratedFromStaging
-
setScheduleItemId
Used to keep track of which item in a schedule was used for this car.- Parameters:
id- The ScheduleItem id for this car.
-
getScheduleItemId
-
getScheduleItem
-
setNextLoadName
Only here for backwards compatibility before version 5.1.4. The next load name for this car. Normally set by a schedule.- Parameters:
load- the next load name.
-
getNextLoadName
-
getWeightTons
- Overrides:
getWeightTonsin classRollingStock
-
getAdjustedWeightTons
Returns a car's weight adjusted for load. An empty car's weight is 1/3 the car's loaded weight.- Overrides:
getAdjustedWeightTonsin classRollingStock
-
setWait
-
getWait
-
setPickupScheduleId
Sets when this car will be picked up (day of the week)- Parameters:
id- See TrainSchedule.java
-
getPickupScheduleId
-
getPickupScheduleName
-
setFinalDestination
Sets the final destination for a car.- Parameters:
destination- The final destination for this car.
-
getFinalDestination
-
getFinalDestinationName
-
getSplitFinalDestinationName
-
setFinalDestinationTrack
-
getFinalDestinationTrack
-
getFinalDestinationTrackName
-
getSplitFinalDestinationTrackName
-
setPreviousFinalDestination
-
getPreviousFinalDestination
-
getPreviousFinalDestinationName
-
setPreviousFinalDestinationTrack
-
getPreviousFinalDestinationTrack
-
getPreviousFinalDestinationTrackName
-
setPreviousScheduleId
-
getPreviousScheduleId
-
setReturnWhenEmptyDestination
-
getReturnWhenEmptyDestination
-
getReturnWhenEmptyDestinationName
-
getSplitReturnWhenEmptyDestinationName
-
setReturnWhenEmptyDestTrack
-
getReturnWhenEmptyDestTrack
-
getReturnWhenEmptyDestTrackName
-
getSplitReturnWhenEmptyDestinationTrackName
-
setReturnWhenLoadedDestination
-
getReturnWhenLoadedDestination
-
getReturnWhenLoadedDestinationName
-
setReturnWhenLoadedDestTrack
-
getReturnWhenLoadedDestTrack
-
getReturnWhenLoadedDestTrackName
-
isRwlEnabled
Used to determine is car has been given a Return When Loaded (RWL) address or custom load- Returns:
- true if car has RWL
-
setRoutePath
-
getRoutePath
-
setCaboose
-
isCaboose
-
setUtility
-
isUtility
-
isLocalMove
Used to determine if car is performing a local move. A local move is when a car is moved to a different track at the same location.- Returns:
- true if local move
-
setKernel
A kernel is a group of cars that are switched as a unit.- Parameters:
kernel- The assigned Kernel for this car.
-
getKernel
-
getKernelName
-
isLead
Used to determine if car is lead car in a kernel- Returns:
- true if lead car in a kernel
-
updateKernel
Updates all cars in a kernel. After the update, the cars will all have the same final destination, load, and route path. -
getTotalKernelLength
Returns the car length or the length of the car's kernel including couplers.- Returns:
- length of car or kernel
-
checkDestination
Used to determine if a car can be set out at a destination (location). Track is optional. In addition to all of the tests that checkDestination performs, spurs with schedules are also checked.- Overrides:
checkDestinationin classRollingStock- Parameters:
destination- The Location.track- The Track at destination.- Returns:
- status OKAY, TYPE, ROAD, LENGTH, ERROR_TRACK, CAPACITY, SCHEDULE, CUSTOM
-
setDestination
Sets the car's destination on the layout- Overrides:
setDestinationin classRollingStock- Parameters:
track- (yard, spur, staging, or interchange track)destination- The Location.- Returns:
- "okay" if successful, "type" if the rolling stock's type isn't acceptable, or "length" if the rolling stock length didn't fit, or Schedule if the destination will not accept the car because the spur has a schedule and the car doesn't meet the schedule requirements. Also changes the car load status when the car reaches its destination.
-
setDestination
Sets the car's destination on the layout- Overrides:
setDestinationin classRollingStock- Parameters:
track- (yard, spur, staging, or interchange track)force- when true ignore track length, type, and road when setting destinationdestination- The Location.- Returns:
- "okay" if successful, "type" if the rolling stock's type isn't acceptable, or "length" if the rolling stock length didn't fit, or Schedule if the destination will not accept the car because the spur has a schedule and the car doesn't meet the schedule requirements. Also changes the car load status when the car reaches its destination. Removes car if clone.
-
loadCarFinalDestination
Called when setting a car's destination to this spur. Loads the car with a final destination which is the ship address for the schedule item.- Parameters:
scheduleItem- The schedule item to be applied this this car
-
loadNext
Called when car is delivered to track. Updates the car's wait, pickup day, and load if spur. If staging, can swap default loads, force load to default empty, or replace custom loads with the default empty load. Can trigger RWE or RWL.- Parameters:
track- the destination track for this car
-
updateLoad
Updates a car's load when placed at a spur. Load change delayed if wait count is greater than zero.- Parameters:
track- The spur the car is sitting on
-
getTypeExtensions
-
reset
- Overrides:
resetin classRollingStock
-
dispose
Description copied from class:RollingStockRemove rolling stock. Releases all listeners.- Overrides:
disposein classRollingStock
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-cars.dtd.- Returns:
- Contents in a JDOM Element
-
setDirtyAndFirePropertyChange
- Overrides:
setDirtyAndFirePropertyChangein classRollingStock
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classRollingStock
-