|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.operations.rollingstock.RollingStock
public class RollingStock
Represents rolling stock, both powered (engines) and not powered (cars) on the layout.
| Constructor Summary | |
|---|---|
RollingStock()
|
|
RollingStock(String road,
String number)
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
|
static String |
createId(String road,
String number)
|
void |
dispose()
Remove rolling stock. |
protected void |
firePropertyChange(String p,
Object old,
Object n)
|
int |
getAdjustedWeightTons()
|
String |
getBuilt()
|
String |
getColor()
|
String |
getComment()
|
Location |
getDestination()
|
String |
getDestinationId()
|
String |
getDestinationName()
|
Track |
getDestinationTrack()
|
String |
getDestinationTrackId()
|
String |
getDestinationTrackName()
|
String |
getId()
|
String |
getLength()
|
Location |
getLocation()
|
String |
getLocationId()
Get rolling stock's location id |
String |
getLocationName()
Get rolling stock's location name |
int |
getMoves()
|
String |
getNumber()
|
String |
getOwner()
|
String |
getPriority()
|
String |
getRfid()
|
String |
getRoad()
|
RouteLocation |
getRouteDestination()
|
String |
getRouteDestinationId()
|
RouteLocation |
getRouteLocation()
|
String |
getRouteLocationId()
|
String |
getSavedRouteId()
|
String |
getStatus()
|
Track |
getTrack()
|
String |
getTrackId()
Get rolling stock's track id |
String |
getTrackName()
Get rolling stock's track name |
Train |
getTrain()
|
String |
getTrainName()
|
String |
getType()
|
String |
getValue()
|
String |
getWeight()
|
String |
getWeightTons()
|
boolean |
isLocationUnknown()
|
boolean |
isOutOfService()
|
void |
moveRollingStock(RouteLocation old,
RouteLocation next)
|
void |
propertyChange(PropertyChangeEvent e)
|
void |
removePropertyChangeListener(PropertyChangeListener l)
|
protected void |
reset()
|
void |
rollingStock(Element e)
Construct this Entry from XML. |
void |
setBuilt(String built)
|
void |
setColor(String color)
|
void |
setComment(String comment)
|
void |
setDestination(Location destination)
Sets rolling stock destination without reserving destination track space or drop count. |
String |
setDestination(Location destination,
Track track)
Sets rolling stock destination on the layout |
String |
setDestination(Location destination,
Track track,
boolean force)
Sets rolling stock destination on the layout |
void |
setDestinationTrack(Track track)
Sets rolling stock destination track without reserving destination track space or drop count. |
void |
setLength(String length)
Sets the length of the rolling stock. |
void |
setLocation(Location location)
Set the rolling stock's location. |
String |
setLocation(Location location,
Track track)
Sets rolling stock location on the layout |
String |
setLocation(Location location,
Track track,
boolean force)
Sets rolling stock location on the layout |
void |
setLocationUnknown(boolean unknown)
Set the rolling stock location as unknown. |
void |
setMoves(int moves)
|
void |
setNumber(String number)
Set the rolling stock identification or road number |
void |
setOutOfService(boolean outOfService)
Sets the rolling stock service state. |
void |
setOwner(String owner)
|
void |
setRfid(String id)
Sets the RFID for this rolling stock. |
void |
setRoad(String road)
|
void |
setRouteDestination(RouteLocation routeDestination)
Set where in a train's route this rolling stock will be set out. |
void |
setRouteLocation(RouteLocation routeLocation)
Sets the location where the rolling stock will be picked up by the train. |
void |
setSavedRouteId(String id)
|
void |
setTrack(Track track)
Set the rolling stock's track. |
void |
setTrain(Train train)
Sets the train that will service this rolling stock. |
void |
setType(String type)
|
void |
setValue(String value)
Sets the value (cost, price) for this rolling stock. |
void |
setWeight(String weight)
|
void |
setWeightTons(String weight)
|
Element |
store(Element e)
Add XML elements to represent this Entry. |
String |
testDestination(Location destination,
Track track)
Used to check destination track to see if it will accept rolling stock |
String |
testLocation(Location location,
Track track)
|
String |
toString()
For combobox and identification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final ResourceBundle rb
protected static final String DEFAULT_WEIGHT
protected String _id
protected String _number
protected String _road
protected String _type
protected String _length
protected String _color
protected String _weight
protected String _weightTons
protected String _built
protected String _owner
protected String _comment
protected String _routeId
protected String _rfid
protected String _value
protected boolean _locationUnknown
protected boolean _outOfService
protected Location _location
protected Track _trackLocation
protected Location _destination
protected Track _trackDestination
protected Train _train
protected RouteLocation _routeLocation
protected RouteLocation _routeDestination
protected int _moves
public int number
public static final String ERROR_TRACK
public static final String LOCATION_CHANGED_PROPERTY
public static final String TRACK_CHANGED_PROPERTY
public static final String DESTINATION_CHANGED_PROPERTY
public static final String DESTINATIONTRACK_CHANGED_PROPERTY
public static final String TRAIN_CHANGED_PROPERTY
public static final String LENGTH_CHANGED_PROPERTY
public static final String TYPE_CHANGED_PROPERTY
public static final int COUPLER
| Constructor Detail |
|---|
public RollingStock()
public RollingStock(String road,
String number)
| Method Detail |
|---|
public static String createId(String road,
String number)
public String getId()
public void setNumber(String number)
number - public String getNumber()
public void setRoad(String road)
public String getRoad()
public String toString()
toString in class Objectpublic void setType(String type)
public String getType()
public void setLength(String length)
length - public String getLength()
public void setColor(String color)
public String getColor()
public void setWeight(String weight)
weight - rolling stock weight in ounces.public String getWeight()
public void setWeightTons(String weight)
weight - full scale rolling stock weight in tons.public String getWeightTons()
public int getAdjustedWeightTons()
public void setBuilt(String built)
public String getBuilt()
public String getStatus()
public Location getLocation()
public void setLocation(Location location)
location - where to set the rolling stock.public String getLocationName()
public String getLocationId()
public Track getTrack()
public void setTrack(Track track)
track - to place the rolling stock on.public String getTrackName()
public String getTrackId()
public String setLocation(Location location,
Track track)
location - track - (yard, spur, staging, or interchange track)
public String setLocation(Location location,
Track track,
boolean force)
location - track - (yard, spur, staging, or interchange track)force - when true place rolling stock ignore track length, type, & road
public String testLocation(Location location,
Track track)
public String setDestination(Location destination,
Track track)
destination - track - (yard, spur, staging, or interchange track)
public String setDestination(Location destination,
Track track,
boolean force)
destination - track - (yard, spur, staging, or interchange track)force - when true ignore track length, type, & road when setting destination
public String testDestination(Location destination,
Track track)
destination - track -
public Location getDestination()
public void setDestination(Location destination)
destination - for the rolling stockpublic String getDestinationName()
public String getDestinationId()
public void setDestinationTrack(Track track)
track - public Track getDestinationTrack()
public String getDestinationTrackName()
public String getDestinationTrackId()
public void setMoves(int moves)
public int getMoves()
public void setTrain(Train train)
train - public Train getTrain()
public String getTrainName()
public void setRouteLocation(RouteLocation routeLocation)
routeLocation - the pick up location for this rolling stock.public RouteLocation getRouteLocation()
public String getRouteLocationId()
public String getSavedRouteId()
public void setSavedRouteId(String id)
public String getValue()
public void setValue(String value)
value - a string representing what
this item is worth.public String getRfid()
public void setRfid(String id)
id - 12 character RFID string.public void setRouteDestination(RouteLocation routeDestination)
routeDestination - the location where the rolling stock is to leave the train.public RouteLocation getRouteDestination()
public String getRouteDestinationId()
public void setOwner(String owner)
public String getOwner()
public void setLocationUnknown(boolean unknown)
unknown - when true, the rolling stock location is unknown.public boolean isLocationUnknown()
public void setOutOfService(boolean outOfService)
outOfService - when true, out of servicepublic boolean isOutOfService()
public String getPriority()
public void setComment(String comment)
public String getComment()
public void moveRollingStock(RouteLocation old,
RouteLocation next)
protected void reset()
public void dispose()
public void rollingStock(Element e)
e - RollingStock XML elementpublic Element store(Element e)
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
protected void firePropertyChange(String p,
Object old,
Object n)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||