scheduler
Class TravelPartConnectionChunk

java.lang.Object
  extended byscheduler.TravelPart
      extended byscheduler.TravelPartConnectionChunk
All Implemented Interfaces:
java.lang.Cloneable

public final class TravelPartConnectionChunk
extends TravelPart
implements java.lang.Cloneable

A class describing a piece of a real connection used to fill a travel part. A list of such chunks creates a final travel plan.

Author:
Piotrek

Field Summary
private  int destinationStationIndex
          An index of the destination station in the real connection's stations list.
private  java.util.Date endDate
          The end date of this travel part.
 int extraTimeBeforeDeparture
          An extra time in minutes the traveler is at the station before the departure (after the change).
private  int originStationIndex
          An index of the origin station in the real connection's stations list.
private  Connection realConnection
          A connection this travel part is taken by.
private  java.util.Date startDate
          The start date of this travel part.
 
Fields inherited from class scheduler.TravelPart
 
Constructor Summary
TravelPartConnectionChunk(int meanOfTransportation, Location origin, Location destination)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Gets a copy of this connection chunk.
 int GetDestinationStationIndex()
          Gets the index of the destination station in the real connection's stations list.
 java.util.Date GetEndDate()
          Gets the end date of this travel part.
 int GetOriginStationIndex()
          Gets the index of the origin station in the real connection's stations list.
 Connection GetRealConnection()
          Gets a reference to the real connection this travel part is taken by.
 TravelPartConnectionChunk GetRevertedConnectionChunk()
          Gets a reverted connection chunk.
 TravelPart GetRevertedPart()
          Calls GetRevertedConnectionChunk().
 java.util.Date GetStartDate()
          Gets the start date of this travel part.
 void SetDestinationStationIndex(int destinationStationIndex)
          Sets the index of the destination station in the real connection's stations list.
 void SetEndDate(java.util.Date endDate)
          Sets the end date of this travel part.
 void SetOriginStationIndex(int originStationIndex)
          Sets the index of the origin station in the real connection's stations list.
 void SetRealConnection(Connection realConnection)
          Sets the reference to the real connection this travel part is taken by.
 void SetStartDate(java.util.Date startDate)
          Sets the start date of this travel part.
 
Methods inherited from class scheduler.TravelPart
GetDestination, GetDestinationStation, GetMeanOfTransportation, GetOrigin, GetOriginStation, SetDestinationStation, SetOriginStation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startDate

private java.util.Date startDate
The start date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.


endDate

private java.util.Date endDate
The end date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.


realConnection

private Connection realConnection
A connection this travel part is taken by.


originStationIndex

private int originStationIndex
An index of the origin station in the real connection's stations list. The value of -1 means this part of travel is taken by a taxi or by a walk.


destinationStationIndex

private int destinationStationIndex
An index of the destination station in the real connection's stations list. The value of -1 means this part of travel is taken by a taxi or by a walk.


extraTimeBeforeDeparture

public int extraTimeBeforeDeparture
An extra time in minutes the traveler is at the station before the departure (after the change). For example, this might be a time one need to be at the airport before the flight - assuming one got to the airport by bus, there is a change time after getting out of the bus for a walk to the airport and just then there is this extra time.

Constructor Detail

TravelPartConnectionChunk

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

Parameters:
meanOfTransportation - A mean of transportation.
origin - An origin location of this part of travel.
destination - A destination location of this part of travel.
Method Detail

GetOriginStationIndex

public int GetOriginStationIndex()
Gets the index of the origin station in the real connection's stations list.

Returns:
The index of the origin station in the real connection's stations list. The value of -1 means this part of travel is taken by a taxi or by a walk.

SetOriginStationIndex

public void SetOriginStationIndex(int originStationIndex)
Sets the index of the origin station in the real connection's stations list.

Parameters:
originStationIndex - The index of the origin station in the real connection's stations list.

GetDestinationStationIndex

public int GetDestinationStationIndex()
Gets the index of the destination station in the real connection's stations list.

Returns:
The index of the destination station in the real connection's stations list. The value of -1 means this part of travel is taken by a taxi or by a walk.

SetDestinationStationIndex

public void SetDestinationStationIndex(int destinationStationIndex)
Sets the index of the destination station in the real connection's stations list.

Parameters:
destinationStationIndex - The index of the destination station in the real connection's stations list.

GetRealConnection

public Connection GetRealConnection()
Gets a reference to the real connection this travel part is taken by.

Returns:
The reference to the real connection this travel part is taken by. A null value means there is none connection (in case of a walk or a taxi).

SetRealConnection

public void SetRealConnection(Connection realConnection)
Sets the reference to the real connection this travel part is taken by.

Parameters:
realConnection - A reference to the real connection part this travel part is taken by. A null value means there is no connection (in case of a walk or a taxi).

GetStartDate

public java.util.Date GetStartDate()
Gets the start date of this travel part.

Returns:
A start date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.

SetStartDate

public void SetStartDate(java.util.Date startDate)
Sets the start date of this travel part.

Parameters:
startDate - A start date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.

GetEndDate

public java.util.Date GetEndDate()
Gets the end date of this travel part.

Returns:
An end date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.

SetEndDate

public void SetEndDate(java.util.Date endDate)
Sets the end date of this travel part.

Parameters:
endDate - An end date of this travel part. Null value means it must be computed basing on the subsequent connection chunk at the later time.

clone

public java.lang.Object clone()
Gets a copy of this connection chunk.

Returns:
A copy of this connection chunk.

GetRevertedPart

public TravelPart GetRevertedPart()
Calls GetRevertedConnectionChunk().

Overrides:
GetRevertedPart in class TravelPart
Returns:
The reverted travel part.
See Also:
TravelPart.GetRevertedPart(), GetRevertedConnectionChunk()

GetRevertedConnectionChunk

public TravelPartConnectionChunk GetRevertedConnectionChunk()
Gets a reverted connection chunk.

Returns:
The reverted connection chunk.