jfreerails.world.cargo
Class CargoBatch

java.lang.Object
  extended by jfreerails.world.cargo.CargoBatch
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CargoBatch>, FreerailsSerializable

public class CargoBatch
extends java.lang.Object
implements FreerailsSerializable, java.lang.Comparable<CargoBatch>

This class represents a cargo batch (cargo of the same batch is cargo of the same type that was produced at the same location at the same time).

Author:
Luke
See Also:
Serialized Form

Field Summary
private  int cargoType
           
private static long serialVersionUID
           
private  int sourceX
           
private  int sourceY
           
private  int stationOfOrigin
           
private  long timeCreated
           
 
Constructor Summary
CargoBatch(int type, int x, int y, long time, int origin)
           
 
Method Summary
 int compareTo(CargoBatch o)
           
 boolean equals(java.lang.Object o)
           
 int getCargoType()
           
 int getSourceX()
           
 int getSourceY()
           
 int getStationOfOrigin()
           
 long getTimeCreated()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

cargoType

private final int cargoType

sourceX

private final int sourceX

sourceY

private final int sourceY

stationOfOrigin

private final int stationOfOrigin

timeCreated

private final long timeCreated
Constructor Detail

CargoBatch

public CargoBatch(int type,
                  int x,
                  int y,
                  long time,
                  int origin)
Method Detail

getStationOfOrigin

public int getStationOfOrigin()

getCargoType

public int getCargoType()

getSourceX

public int getSourceX()

getSourceY

public int getSourceY()

getTimeCreated

public long getTimeCreated()

equals

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

hashCode

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

compareTo

public int compareTo(CargoBatch o)
Specified by:
compareTo in interface java.lang.Comparable<CargoBatch>