edu.lmu.liftor
Class Traveller

java.lang.Object
  |
  +--edu.lmu.liftor.Traveller
All Implemented Interfaces:
Person.Personality
Direct Known Subclasses:
Traveller.FloorTraveller, Traveller.VagrantTraveller

public abstract class Traveller
extends java.lang.Object
implements Person.Personality

A traveller travels among floors in a building.


Nested Class Summary
static class Traveller.FloorTraveller
          A floor traveller is a traveller that moves about the building with a sense of direction.
static class Traveller.RandomFloorTraveller
          A random floor traveller moves randomly amongst floors.
static class Traveller.VagrantTraveller
          The vagrant travller is simply a random mover.
 
Field Summary
protected  SynchronizedLong journeyStart
           
static Channel travelReports
          A channel containing reports (SynchronizedInts) of the time of recent journeys.
protected  SynchronizedLong travelTime
          The time of the last journey.
static Person.Personality VAGRANT
          A vagrant that wanders about.
 
Method Summary
protected  void beginJourney()
           
protected  void endJourney()
           
 long getLastJourneyTime()
          Get the time of this Traveller's last journey.
 java.lang.String getName()
          Returns the name of this personality.
 boolean inTransit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.lmu.liftor.Person.Personality
motivate
 

Field Detail

travelTime

protected SynchronizedLong travelTime
The time of the last journey.


journeyStart

protected SynchronizedLong journeyStart

travelReports

public static final Channel travelReports
A channel containing reports (SynchronizedInts) of the time of recent journeys. Note that these reports might have been re-used since being placed in here so the semantics of a journey report should be respected.


VAGRANT

public static final Person.Personality VAGRANT
A vagrant that wanders about.

Method Detail

getName

public java.lang.String getName()
Description copied from interface: Person.Personality
Returns the name of this personality. Preferably an adverb.

Specified by:
getName in interface Person.Personality

getLastJourneyTime

public long getLastJourneyTime()
Get the time of this Traveller's last journey. Returns zero if the traveller is in-transit.


inTransit

public boolean inTransit()

beginJourney

protected void beginJourney()

endJourney

protected void endJourney()