|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectscheduler.ConnectionsFinderTask
A class used to store a single task in the tasks list
Field Summary | |
private int |
changesCount
A number of changes in the list of the connection chunks. |
Connection |
connection
A current real connection the work is done upon. |
private java.util.ArrayList |
currentConnectionChunks
A list of currently so far added connection chunks within the current travel part. |
Station |
currentStation
A current work station (within the current connection). |
char |
dayOfWeek
A day of week the current connection starts on. |
int |
extraTimeBeforeDeparture
An extra time in minutes the traveler is at the station before the departure (after the change). |
boolean |
fDirect
Indicates whether the connection is a direct connection to the destination station. |
double |
historyBasedJudgement
This parameter might be set by the judgement module basing on the history. |
Station |
startStation
A starting station used to remember the station where the new connection chunk should start. |
java.util.Date |
startStationDepartureDate
A date of departure from the start station. |
private java.util.ArrayList |
unsetDatesChunksIndecies
A list of idecies of the chunks with at least one of the start and end dates being unset. |
private java.util.ArrayList |
usedMeansOfTransportation
A current list of used means of transportation. |
private java.util.ArrayList |
visitedStations
A list of visited stations used to detect the cycles. |
Constructor Summary | |
ConnectionsFinderTask()
Constructor |
Method Summary | |
void |
AddConnectionChunk(TravelPartConnectionChunk connectionChunk)
Adds a new connection chunk at the end of the current list of connection chunks. |
void |
AddVisitedStation(Station station)
Adds a station to the list of visited stations. |
void |
ClearVisitedStations()
Clears the list of visited stations. |
java.lang.Object |
clone()
A clone has the reference to the same connection chunks except for the chunks with at least one unset date (those are new copies). |
int |
GetAverageChangeDuration()
Gets a duration of the average change. |
int |
GetChangesCount()
Gets a number of changes in the list of the connection chunks. |
TravelPartConnectionChunk |
GetChunk(int chunkIndex)
Gets the connection chunk with the given index. |
java.util.Iterator |
GetConnectionChunks()
Gets a current list of connection chunks. |
int |
GetConnectionChunksCount()
Gets a number of connection chunks contained by this task at the moment. |
TravelPartConnectionChunk |
GetFirstConnectionChunk()
Gets the first connection chunk in the list. |
TravelPartConnectionChunk |
GetLastConnectionChunk()
Gets the last connection chunk in the list. |
TravelPartConnectionChunk |
GetLastConnectionChunkWithEndDate()
Gets the last connection chunk in the list with the end date set. |
int |
GetMaxChangeDuration()
Gets a duration of the longest change. |
double |
GetTotalDistance()
Gets the total distance of the travel described by this task. |
int |
GetTotalDuration()
Gets a total duration of the travel stored in this task. |
java.util.Iterator |
GetUnsetDatesChunksIndecies()
Gets an iterator to the list of chunks with the unset dates. |
java.util.ArrayList |
GetUsedMeansOfTransportation()
Gets a list of used means of transportation. |
boolean |
HasUnsetDatesChunks()
Gets a boolean value indicating whether this task has some connection chunks with unset dates. |
boolean |
HasVisitedStation(Station station)
Checks whether the given station has been visited before. |
boolean |
IsSimilar(ConnectionsFinderTask otherTask)
Checks whether this task is similar to the given one. |
void |
SetCurrentWorkingData(ConnectionsFinderTask otherTask)
Sets the current connection, day of week, current station and the start station to the same values as of the other one's. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.ArrayList visitedStations
private java.util.ArrayList currentConnectionChunks
private java.util.ArrayList unsetDatesChunksIndecies
public Connection connection
public Station currentStation
public Station startStation
public char dayOfWeek
Connection.MONDAY
,
Connection.TUESDAY
,
Connection.WEDNESDAY
,
Connection.THURSDAY
,
Connection.FRIDAY
,
Connection.SATURDAY
,
Connection.SUNDAY
public java.util.Date startStationDepartureDate
private int changesCount
public boolean fDirect
private java.util.ArrayList usedMeansOfTransportation
public int extraTimeBeforeDeparture
public double historyBasedJudgement
Constructor Detail |
public ConnectionsFinderTask()
Method Detail |
public void AddVisitedStation(Station station)
station
- A station to be added.public boolean HasVisitedStation(Station station)
station
- A station to be tested.
public java.util.Iterator GetUnsetDatesChunksIndecies()
public boolean HasUnsetDatesChunks()
public TravelPartConnectionChunk GetChunk(int chunkIndex)
chunkIndex
- An index of the connection chunk to be returned.
public void AddConnectionChunk(TravelPartConnectionChunk connectionChunk)
connectionChunk
- A connection chunk to be added.public java.util.Iterator GetConnectionChunks()
public TravelPartConnectionChunk GetFirstConnectionChunk()
public TravelPartConnectionChunk GetLastConnectionChunk()
public TravelPartConnectionChunk GetLastConnectionChunkWithEndDate()
public java.lang.Object clone()
Object.clone()
public int GetChangesCount()
public void ClearVisitedStations()
public void SetCurrentWorkingData(ConnectionsFinderTask otherTask)
otherTask
- A source of settings.public int GetConnectionChunksCount()
public int GetTotalDuration()
public boolean IsSimilar(ConnectionsFinderTask otherTask)
otherTask
- The other task this one is to be compared.
public int GetMaxChangeDuration()
public int GetAverageChangeDuration()
public double GetTotalDistance()
public java.util.ArrayList GetUsedMeansOfTransportation()
MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.SHIP
,
MeanOfTransportation.TAXI
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.WALK
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |