StandByApplet
Class StandByPassenger
java.lang.Object
|
+--StandByApplet.StandByPassenger
- class StandByPassenger
- extends Object
- implements Comparable
A passenger waiting for a flight. You need to modify the compareTo()
method so the proper order is maintained.
|
Method Summary |
int |
compareTo(Object o)
Compares to another StandByPassenger. |
boolean |
equals(Object o)
Overrides Object.equals so the natural ordering consistent with equals. |
int |
hashCode()
Returns the hashcode for this StandByPassenger. |
String |
toString()
Convert to a String to make displaying easy in a java.awt.List |
ticket
String ticket
name
String name
frequentFlyerID
String frequentFlyerID
clubID
String clubID
checkInTime
Date checkInTime
StandByPassenger
StandByPassenger(String ticket,
String name,
String frequentFlyerID,
String clubID,
Date checkInTime)
compareTo
public int compareTo(Object o)
- Compares to another StandByPassenger. Ensure that the ordering has:
- Passengers that are members of our airline's club are first
- then passengers that are frequent flyers
- then general passengers
Use checkInTime to compare within each class of passengers.
You need to modify this method.
- Specified by:
- compareTo in interface Comparable
toString
public String toString()
- Convert to a String to make displaying easy in a java.awt.List
- Overrides:
- toString in class Object
equals
public boolean equals(Object o)
- Overrides Object.equals so the natural ordering consistent with equals.
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Returns the hashcode for this StandByPassenger.
- Overrides:
- hashCode in class Object