public class ChairsSet { // The set of chairs
private boolean Occupied[ ];
private boolean Valid[ ];
private int Count;
private int OccupiedChairs = 0;
private int ValidChairs = 0;
public ChairsSet(int numberOfChairs)
{ // Constructor
//this.name = "aKid";
}//end constructor
public synchronized void removeChair( ) {
}//removeChair
public synchronized int takeASeat( )
{ // Player sits down
}//takeASeat
public synchronized void getOutOfSeat(int seat)
{ // Player leaves chair
}
public synchronized int validChairs( )
{ // How many chairs left?
} public synchronized int occupiedChairs( )
{ // How many chairs are in use?
} public synchronized boolean allSeated( )
{ // All chairs occupied?
}
}//ChairSet
Aucun commentaire:
Enregistrer un commentaire