scheduler
Class TravelPart

java.lang.Object
  extended byscheduler.TravelPart
Direct Known Subclasses:
TravelPartConnectionChunk

public class TravelPart
extends java.lang.Object

A travel part.

Author:
Piotrek

Field Summary
private  Location destination
          The destination of this travel part.
private  Station destinationStation
          A station related to the destination.
private  int meanOfTransportation
          A mean of transportation this part is to be taken by.
private  Location origin
          The origin of this travel part.
private  Station originStation
          A station related to the origin.
 
Constructor Summary
TravelPart(int meanOfTransportation, Location origin, Location destination)
          Constructor.
 
Method Summary
 Location GetDestination()
          Gets ths destination of this travel part.
 Station GetDestinationStation()
          Gets the destination related station.
 int GetMeanOfTransportation()
          Gets the mean of transportations this travel part is to be taken by.
 Location GetOrigin()
          Gets the origin of this travel part.
 Station GetOriginStation()
          Gets the origin related station.
 TravelPart GetRevertedPart()
          Gets the reverted travel part.
 void SetDestinationStation(Station station)
          Sets the station related to the destination.
 void SetOriginStation(Station station)
          Sets the station related to the origin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

meanOfTransportation

private int meanOfTransportation
A mean of transportation this part is to be taken by.

See Also:
MeanOfTransportation.AIRPLANE, MeanOfTransportation.BUS, MeanOfTransportation.TRAIN, MeanOfTransportation.SHIP

origin

private Location origin
The origin of this travel part.


destination

private Location destination
The destination of this travel part.


originStation

private Station originStation
A station related to the origin.


destinationStation

private Station destinationStation
A station related to the destination.

Constructor Detail

TravelPart

public TravelPart(int meanOfTransportation,
                  Location origin,
                  Location destination)
Constructor.

Parameters:
meanOfTransportation - The mean of transportation this travel part is to be taken by.
origin - The origin location of this travel part.
destination - The destination location of this travel part.
See Also:
MeanOfTransportation.AIRPLANE, MeanOfTransportation.BUS, MeanOfTransportation.TRAIN, MeanOfTransportation.SHIP
Method Detail

GetMeanOfTransportation

public int GetMeanOfTransportation()
Gets the mean of transportations this travel part is to be taken by.

Returns:
Returns the mean of transportation this travel part is to be taken by.
See Also:
MeanOfTransportation.AIRPLANE, MeanOfTransportation.BUS, MeanOfTransportation.TRAIN, MeanOfTransportation.SHIP

GetOrigin

public Location GetOrigin()
Gets the origin of this travel part.

Returns:
The location of this tracel part.

GetDestination

public Location GetDestination()
Gets ths destination of this travel part.

Returns:
The destination of this travel part.

SetOriginStation

public void SetOriginStation(Station station)
Sets the station related to the origin.

Parameters:
station - A station to be set.

GetOriginStation

public Station GetOriginStation()
Gets the origin related station.

Returns:
The origin related station or null if there is none set.

SetDestinationStation

public void SetDestinationStation(Station station)
Sets the station related to the destination.

Parameters:
station - A station to be set.

GetDestinationStation

public Station GetDestinationStation()
Gets the destination related station.

Returns:
The destination related station or null if there is none set.

GetRevertedPart

public TravelPart GetRevertedPart()
Gets the reverted travel part.

Returns:
The reverted travel part.