net.kolls.railworld.car
Class Boxcar

java.lang.Object
  extended by net.kolls.railworld.car.AbstractCar
      extended by net.kolls.railworld.car.Boxcar
All Implemented Interfaces:
Car, SaveLoad

public class Boxcar
extends AbstractCar

Boxcar based on COP 7274

Author:
Steve Kollmansberger

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
Boxcar()
           
 
Method Summary
 java.awt.Color color()
          Return the Car's color.
 Distance length()
          Returns the length of this Car.
 java.lang.String show()
          Gives a human-readable word for the 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, isEngine, isLoadable, load, load, loaded, midColor, newInstance, save, segs, toString, unload
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Boxcar

public Boxcar()
Method Detail

length

public Distance length()
Description copied from interface: Car
Returns the length of this Car.

Returns:
Distance indicating the length of the Car.

weight

public int weight()
Description copied from interface: Car
Returns the weight of this Car (taking load/unload into account, if necessary) in US Tons. 1 US Ton = 2000 US Pounds

Returns:
int representing weight in tons.

color

public java.awt.Color color()
Description copied from interface: Car
Return the Car's color. The following color assignments exist: black: open hopper car blue: tank car cyan: intermodal dark gray: engine gray: green: covered hopper light gray: passenger magenta: auto rack orange: centerbeam flat car pink: boxcar red: caboose white: yellow: stock car

Returns:
The Color of the current Car.

show

public java.lang.String show()
Description copied from interface: Car
Gives a human-readable word for the Car. Should indicate only the type of the Car, not whether it is loaded or unloaded.

Returns:
String indicating type of Car.