|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.kolls.railworld.car.AbstractCar
net.kolls.railworld.car.Engine
public class Engine
Locomotive based on GE Dash 7
Field Summary |
---|
Fields inherited from class net.kolls.railworld.car.AbstractCar |
---|
isLoaded |
Fields inherited from interface net.kolls.railworld.Car |
---|
CAR_WIDTH, DIST_BETWEEN_CARS |
Constructor Summary | |
---|---|
Engine()
|
Method Summary | |
---|---|
java.awt.Color |
color()
Return the Car's color. |
boolean |
isEngine()
Indicates if this car provides power. |
boolean |
isLoadable()
Determine if the current Car can be loaded and unloaded; that is, does it carry cargo. |
Distance |
length()
Returns the length of this Car. |
void |
load()
Loads the current Car. |
boolean |
loaded()
Indicates if the Car is currently loaded. |
java.lang.String |
show()
Gives a human-readable word for the Car. |
void |
unload()
Unloads the current Car. |
int |
weight()
Returns the weight of this Car (taking load/unload into account, if necessary) in US Tons. |
Methods inherited from class net.kolls.railworld.car.AbstractCar |
---|
canUserCreate, equals, load, midColor, newInstance, save, segs, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Engine()
Method Detail |
---|
public Distance length()
Car
Distance
indicating the length of the Car.public boolean loaded()
Car
loaded
in interface Car
loaded
in class AbstractCar
true
if the car is loadable and is currently loaded.public int weight()
Car
int
representing weight in tons.public java.awt.Color color()
Car
Color
of the current Car.public java.lang.String show()
Car
String
indicating type of Car.public void load()
Car
load
in interface Car
load
in class AbstractCar
public void unload()
Car
unload
in interface Car
unload
in class AbstractCar
public boolean isLoadable()
Car
isLoadable
in interface Car
isLoadable
in class AbstractCar
true
if the Car may be loaded and unloaded. Defaults to true
.public boolean isEngine()
Car
isEngine
in interface Car
isEngine
in class AbstractCar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |