|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.comp211.laundry.student.Student
public class Student
Represents a student and their environment
Field Summary |
---|
Fields inherited from interface edu.rice.comp211.laundry.student.StudentEnvironment |
---|
MAX_LOAD |
Constructor Summary | |
---|---|
Student(String name,
Shirt shirt,
Pants pants,
Socks socks)
Constructor for the class |
|
Student(String name,
Shirt shirt,
Pants pants,
Socks socks,
BiListI<Garment> cleanShirts,
BiListI<Garment> cleanPants,
BiListI<Garment> cleanSocks,
BiListI<Garment> dirtyPile,
BiListI<BiListI<Garment>> laundryRoom)
Constructor for the class |
Method Summary | |
---|---|
BiListI<Garment> |
cleanPants()
Accessor for the pile of clean pants |
BiListI<Garment> |
cleanShirts()
Accessor for the pile of clean shirts |
BiListI<Garment> |
cleanSocks()
Accessor for the pile of clean socks |
BiListI<Garment> |
dirtyPile()
Accessor for the pile of dirty clothes |
boolean |
equals(Object o)
Tests for equality with another object |
void |
execute(Command cmd,
IOProcess io)
Executes a single command cmd, updating the state of student and generating specified PrintStream output to System.out. |
CommandVisitor<String> |
getCommandVisitor()
Factory method for a CommandVisitor<String> that can be used to process Commands for this student |
BiListI<BiListI<Garment>> |
laundryRoom()
Accessor for the laundry room |
String |
name()
Accessor for the student's name |
Pants |
pants()
The current pants the student is wearing |
void |
pants(Pants pPants)
Settor for the current pants the student is wearing |
Shirt |
shirt()
The current shirt the student is wearing |
void |
shirt(Shirt pShirt)
Settor for the current shirt the student is wearing |
void |
simulate(IOProcess io,
boolean debug)
Run a simulation (a series of commands) on the student |
Socks |
socks()
The current socks the student is wearing |
void |
socks(Socks pSocks)
Settor for the current socks the student is wearing |
String |
toString()
a string representation of the student |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Student(String name, Shirt shirt, Pants pants, Socks socks)
name
- the student's nameshirt
- the initial shirt the student is wearingpants
- the initial pants the student is wearingsocks
- the initial socks the student is wearingpublic Student(String name, Shirt shirt, Pants pants, Socks socks, BiListI<Garment> cleanShirts, BiListI<Garment> cleanPants, BiListI<Garment> cleanSocks, BiListI<Garment> dirtyPile, BiListI<BiListI<Garment>> laundryRoom)
name
- the student's nameshirt
- the initial shirt the student is wearingpants
- the initial pants the student is wearingsocks
- the initial socks the student is wearingcleanShirts
- the list to use as the clean shirts pilecleanPants
- the list to use as the clean pants pilecleanSocks
- the list to use as the clean socks piledirtyPile
- the list to use as the dirty clothes pilelaundryRoom
- the list of lists to use as the laundry roomMethod Detail |
---|
public String name()
name
in interface StudentEnvironment
public Shirt shirt()
shirt
in interface StudentEnvironment
public Pants pants()
pants
in interface StudentEnvironment
public Socks socks()
socks
in interface StudentEnvironment
public void shirt(Shirt pShirt)
pShirt
- the new shirt to wearpublic void pants(Pants pPants)
pPants
- the new pants to wearpublic void socks(Socks pSocks)
pSocks
- the new socks to wearpublic BiListI<Garment> cleanShirts()
cleanShirts
in interface StudentEnvironment
public BiListI<Garment> cleanPants()
cleanPants
in interface StudentEnvironment
public BiListI<Garment> cleanSocks()
cleanSocks
in interface StudentEnvironment
public BiListI<Garment> dirtyPile()
dirtyPile
in interface StudentEnvironment
public BiListI<BiListI<Garment>> laundryRoom()
laundryRoom
in interface StudentEnvironment
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
public void simulate(IOProcess io, boolean debug) throws IOException
io
- the IOProcess that supplies commands as well as status display capabilitiesdebug
- a flag used for debugging
IOException
- if an I/O error occurs.public void execute(Command cmd, IOProcess io)
cmd
- the Command object to executeio
- used to print the resultant status string.public CommandVisitor<String> getCommandVisitor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |