|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.lmu.liftor.Person
A person is a mobile visitor that has a personality and runs about.
| Nested Class Summary | |
static class |
Person.Deity
The Deity class manages the heap of runnable people and tosses them into its private thread pool when they are ready to run. |
static class |
Person.PeopleRuntimeComparator
|
static interface |
Person.Personality
A personality is used to control the behavior of a person. |
| Field Summary | |
static Person.Deity |
loki
|
java.lang.String |
name
|
static Person.Personality |
SLACKER
The slacker is a personality that simply sleeps. |
| Constructor Summary | |
Person(java.lang.String name,
Person.Personality p,
Place startAt,
Person.Deity d)
Create a person with the given name. |
|
| Method Summary | |
void |
convert(Person.Deity d)
|
java.lang.String |
getName()
|
static Person |
getNewPerson()
This returns a brand new slacker. |
static Person |
getNewPerson(Person.Personality personality)
A factory that creates a new person. |
Person.Personality |
getPersonality()
|
Place |
getPlace()
Get the place that this person is currently at. |
void |
run()
This run method returns after this Person has been placed back into the run queue. |
void |
setPersonality(Person.Personality p)
|
void |
start()
Get this Person started running. |
java.lang.String |
toString()
|
void |
youAreHere(Place newPlace)
A signal that the Visitor has successfully entered a place. |
void |
youHaveLeft(Place p)
A signal that the Visitor has left a place. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final java.lang.String name
public static final Person.Deity loki
public static final Person.Personality SLACKER
| Constructor Detail |
public Person(java.lang.String name,
Person.Personality p,
Place startAt,
Person.Deity d)
| Method Detail |
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic Place getPlace()
public void convert(Person.Deity d)
public void setPersonality(Person.Personality p)
public Person.Personality getPersonality()
public void start()
start in interface Visitorpublic void run()
run in interface java.lang.Runnablepublic void youAreHere(Place newPlace)
Visitor
youAreHere in interface Visitorpublic void youHaveLeft(Place p)
Visitor
youHaveLeft in interface Visitorpublic static Person getNewPerson(Person.Personality personality)
public static Person getNewPerson()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||