edu.lmu.liftor
Interface Place

All Known Implementing Classes:
Place.PlaceImpl

public interface Place

A place is somewhere that a Visitor may visit.


Nested Class Summary
static class Place.PlaceFullException
          This exception is thrown whenever a place is unable to accept entry of a new visitor.
static class Place.PlaceImpl
          A simple implementation of a Place that tracks and dispatches entrys and exits.
 
Field Summary
static Place LIMBO
          The place that isn't a place at all.
 
Method Summary
 void enter(Visitor visitor)
          Add the visitor to this place.
 void exit(Visitor visitor)
          The given visitor wishes to exit the place.
 int getPlaceCapacity()
          Returns the maximum number of Visitors that can be in this place.
 java.lang.String getPlaceName()
           
 int getVisitorCount()
          Returns the number of Visitors that are currently in this place.
 boolean isFull()
          Returns whether this place is full right now.
 

Field Detail

LIMBO

public static final Place LIMBO
The place that isn't a place at all.

Method Detail

enter

public void enter(Visitor visitor)
           throws Place.PlaceFullException
Add the visitor to this place. Upon success, it will notify new visitors that they are here.

Place.PlaceFullException

exit

public void exit(Visitor visitor)
The given visitor wishes to exit the place.


getVisitorCount

public int getVisitorCount()
Returns the number of Visitors that are currently in this place.


getPlaceCapacity

public int getPlaceCapacity()
Returns the maximum number of Visitors that can be in this place.


isFull

public boolean isFull()
Returns whether this place is full right now. Note that subsequent calls to enter() may still throw a PlaceFullException if someone beats you to the punch.


getPlaceName

public java.lang.String getPlaceName()