jfreerails.world.train
Class TrainModel

java.lang.Object
  extended by jfreerails.world.train.TrainModel
All Implemented Interfaces:
java.io.Serializable, FreerailsSerializable

public class TrainModel
extends java.lang.Object
implements FreerailsSerializable

Represents a train.

Author:
Luke
See Also:
Serialized Form

Field Summary
private  int cargoBundleId
           
private  int engineTypeId
           
static int MAX_NUMBER_OF_WAGONS
           
static int MAX_TRAIN_LENGTH
           
private  int scheduleId
           
private static long serialVersionUID
           
static int WAGON_LENGTH
           
private  ImInts wagonTypes
           
 
Constructor Summary
TrainModel(ImInts wagons, int BundleId)
           
TrainModel(int engine)
           
TrainModel(int engine, ImInts wagons, int scheduleID)
           
TrainModel(int engine, ImInts wagons, int scheduleID, int BundleId)
           
 
Method Summary
 boolean canAddWagon()
           
 boolean equals(java.lang.Object obj)
           
 int getCargoBundleID()
           
 ImInts getConsist()
           
 int getEngineType()
           
 int getLength()
           
 TrainModel getNewInstance(int newEngine, ImInts newWagons)
           
 int getNumberOfWagons()
           
 int getScheduleID()
           
 int getWagon(int i)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAGON_LENGTH

public static final int WAGON_LENGTH
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

MAX_NUMBER_OF_WAGONS

public static final int MAX_NUMBER_OF_WAGONS
See Also:
Constant Field Values

MAX_TRAIN_LENGTH

public static final int MAX_TRAIN_LENGTH
See Also:
Constant Field Values

scheduleId

private final int scheduleId

engineTypeId

private final int engineTypeId

wagonTypes

private final ImInts wagonTypes

cargoBundleId

private final int cargoBundleId
Constructor Detail

TrainModel

public TrainModel(int engine,
                  ImInts wagons,
                  int scheduleID,
                  int BundleId)

TrainModel

public TrainModel(ImInts wagons,
                  int BundleId)

TrainModel

public TrainModel(int engine,
                  ImInts wagons,
                  int scheduleID)

TrainModel

public TrainModel(int engine)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getNewInstance

public TrainModel getNewInstance(int newEngine,
                                 ImInts newWagons)

getLength

public int getLength()

canAddWagon

public boolean canAddWagon()

getNumberOfWagons

public int getNumberOfWagons()

getWagon

public int getWagon(int i)

getEngineType

public int getEngineType()

getCargoBundleID

public int getCargoBundleID()

getScheduleID

public int getScheduleID()

getConsist

public ImInts getConsist()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object