Class Party
java.lang.Object
|
+--Party
- public class Party
- extends java.lang.Object
A class to represent a party in the lunch simulation. A party contains
a certain number of people, a time to arrive, and the amount of time it
takes that party to eat.
- See Also:
EventTimer
Field Summary |
private double |
arrivalTime
When the party arrives for lunch |
private double |
eatingTime
How long the party will take to eat |
private int |
partySize
The size of the party |
Constructor Summary |
Party(int size,
double arrivalTime,
double eatingTime)
Creates a new instance of a Party, with specified characteristics |
Method Summary |
double |
arrivalTime()
Returns the time this Party will arrive, represented as minutes
since the start of lunch. |
double |
eatingTime()
Returns how many minutes it will take for this Party to finish eating |
int |
partySize()
Returns the size of this party |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
partySize
private int partySize
- The size of the party
arrivalTime
private double arrivalTime
- When the party arrives for lunch
eatingTime
private double eatingTime
- How long the party will take to eat
Party
public Party(int size,
double arrivalTime,
double eatingTime)
- Creates a new instance of a Party, with specified characteristics
- Parameters:
size
- the size of this partyarrivalTime
- the time the party arrives for lunch, represented
as minutes since the start of luncheatingTime
- how long it takes this Party to finish eating
partySize
public int partySize()
- Returns the size of this party
arrivalTime
public double arrivalTime()
- Returns the time this Party will arrive, represented as minutes
since the start of lunch.
eatingTime
public double eatingTime()
- Returns how many minutes it will take for this Party to finish eating