fr.jussieu.gla.wasa.samples.party
Class Schedule

java.lang.Object
  |
  +--fr.jussieu.gla.wasa.samples.party.Schedule

public class Schedule
extends java.lang.Object

Holds the current assignations of boats.

Version:
$Revision: 1.2 $ $Date: 2002/04/17 15:24:08 $
Author:
Florent Selva, Laurent Caillette

Constructor Summary
Schedule(Fleet fleet, int periodCount)
           
 
Method Summary
 Boat[] getAllBoats()
          Returns a reference to the Boat array used internally.
 int getBoatCount()
          Returns the number of boats.
 int getGuestCount()
          Returns the number of guest boats.
 Boat[] getGuests()
          Returns an array of the guests.
 Boat getHost(Boat guest, int period)
          Returns the host assigned to the guest at the period period.
 Boat getHost(int index)
          Returns the host of rank index.
 int getHostCount()
          Returns the number of host boats.
 Boat[] getHosts()
          Returns an array of the hosts.
 int getPeriodCount()
          Return the number of period.
 void print(java.io.PrintStream out)
          Display informations about the schedule in a PrintStream.
 void setHost(Boat host, Boat guest, int period)
          Assigns the guest boat at the period period to the host host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule(Fleet fleet,
                int periodCount)
Method Detail

setHost

public void setHost(Boat host,
                    Boat guest,
                    int period)
Assigns the guest boat at the period period to the host host.

getHost

public Boat getHost(Boat guest,
                    int period)
Returns the host assigned to the guest at the period period.
Returns:
the host assigned to the guest at the period period

getPeriodCount

public int getPeriodCount()
Return the number of period.
Returns:
the number of period

getAllBoats

public Boat[] getAllBoats()
Returns a reference to the Boat array used internally. This array should not be modified.
Returns:
The array of Boats.

getBoatCount

public int getBoatCount()
Returns the number of boats.
Returns:
the number of boats.

getGuestCount

public int getGuestCount()
Returns the number of guest boats.
Returns:
the number of guest boats.

getHostCount

public int getHostCount()
Returns the number of host boats.
Returns:
the number of host boats.

getHost

public Boat getHost(int index)
Returns the host of rank index.
Returns:
the host of rank index.

getHosts

public Boat[] getHosts()
Returns an array of the hosts.
Returns:
An array of the hosts.

getGuests

public Boat[] getGuests()
Returns an array of the guests.
Returns:
An array of the guests.

print

public void print(java.io.PrintStream out)
Display informations about the schedule in a PrintStream.