|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectworld.Connection
A connection.
Field Summary | |
private java.util.ArrayList |
arrivals
A list of arrivals for all the stations in this connection. |
private char |
dayOfWeekMask
A day of week mask. |
private java.util.ArrayList |
departures
A list of departures for all the stations in this connection. |
static char |
FRIDAY
A Friday flag for the day of the week. |
private int |
meanOfTransportation
A mean of transportation. |
static char |
MONDAY
A Monday flag for the day of the week. |
private java.lang.String |
name
A name of this connection. |
static char |
SATURDAY
A Saturday flag for the day of the week. |
private java.util.ArrayList |
stations
A list of stations in this connection. |
static char |
SUNDAY
A Sunday flag for the day of the week. |
static char |
THURSDAY
A Thursday flag for the day of the week. |
static char |
TUESDAY
A Tuesday flag for the day of the week. |
static char |
WEDNESDAY
A Wednesday flag for the day of the week. |
Constructor Summary | |
Connection(java.lang.String name,
int meanOfTransportation,
java.util.ArrayList stations,
java.util.ArrayList arrivals,
java.util.ArrayList departures,
char dayOfWeekMask)
Constructor. |
Method Summary | |
static char |
CalendarToConnectionDayOfWeek(int calendarDayOfWeek)
Converts the day of week constant from the Calendar class to the Connection class constant. |
boolean |
equals(java.lang.Object other)
|
java.util.ArrayList |
GetArrivals()
Gets a list of arrivals for all the stations. |
int |
GetArrivalTime(int stationIndex)
Gets an arrival time for the given station's index. |
char |
GetDayOfWeekMask()
Gets the day of week mask. |
java.util.ArrayList |
GetDepartures()
Gets a list of departures for all the stations. |
int |
GetDepartureTime(int stationIndex)
Gets a departure time for the given station's index. |
int |
GetMeanOfTransportation()
Gets the mean of transportation. |
java.lang.String |
GetName()
Gets a name of this connection. |
int |
GetStationIndex(Station station)
Gets an index of the given station within the stations list of this connection. |
java.util.ArrayList |
GetStations()
Gets a list of stations. |
int |
GetStationsCount()
Gets the number of stations in this connection. |
boolean |
IsEqual(Connection other)
Compares two connections. |
static char |
ShiftDayOfWeek(char dayOfWeek,
int shift)
Shifts the given day of week by the given number of days. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String name
public static final char MONDAY
public static final char TUESDAY
public static final char WEDNESDAY
public static final char THURSDAY
public static final char FRIDAY
public static final char SATURDAY
public static final char SUNDAY
private char dayOfWeekMask
private int meanOfTransportation
private java.util.ArrayList stations
private java.util.ArrayList arrivals
private java.util.ArrayList departures
Constructor Detail |
public Connection(java.lang.String name, int meanOfTransportation, java.util.ArrayList stations, java.util.ArrayList arrivals, java.util.ArrayList departures, char dayOfWeekMask)
name
- A name for the connection.meanOfTransportation
- A mean of transportation for this connection.stations
- An ordered list of stations.arrivals
- An ordered list of arrival times (Integers representing the time.)departures
- An ordered list of departure times (Integers representing the time.)dayOfWeekMask
- A day of week mask.MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.SHIP
,
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
,
SUNDAY
Method Detail |
public java.lang.String GetName()
public char GetDayOfWeekMask()
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
,
SUNDAY
public int GetMeanOfTransportation()
MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.SHIP
public java.util.ArrayList GetStations()
public java.util.ArrayList GetArrivals()
public java.util.ArrayList GetDepartures()
public int GetStationIndex(Station station)
station
- A station to search the index for.
public int GetArrivalTime(int stationIndex)
stationIndex
- A station's index.
public int GetDepartureTime(int stationIndex)
stationIndex
- A station's index.
public static char CalendarToConnectionDayOfWeek(int calendarDayOfWeek)
calendarDayOfWeek
- A constant from the Calendar class.
Calendar.MONDAY
,
Calendar.TUESDAY
,
Calendar.WEDNESDAY
,
Calendar.THURSDAY
,
Calendar.FRIDAY
,
Calendar.SATURDAY
,
Calendar.SUNDAY
public static char ShiftDayOfWeek(char dayOfWeek, int shift)
dayOfWeek
- A day of week to be shifted.shift
- A number of days to shift the given day of week.
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
,
SUNDAY
public int GetStationsCount()
public boolean equals(java.lang.Object other)
Object.equals(java.lang.Object)
public boolean IsEqual(Connection other)
other
- A connection this connection is to be compared against.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |