java.lang.ObjectBrain
public class Brain
Represents a primitive brain. The brain can be in one of two states: awake or asleep. The brain can also keep track of one thought.
Constructor Summary | |
---|---|
Brain()
Creates a new brain |
Method Summary | |
---|---|
boolean |
getAwake()
Returns whether organism is awake or not |
java.lang.String |
getThought()
Returns the current thought |
void |
setAwake(boolean newStatus)
Set the status of the brain to awake or asleep |
void |
setThought(java.lang.String newThought)
Update thought |
java.lang.String |
toString()
Returns a string representation of the brain |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Brain()
Method Detail |
---|
public boolean getAwake()
public java.lang.String getThought()
public void setAwake(boolean newStatus)
newStatus
- true if awake anad false if asleeppublic void setThought(java.lang.String newThought)
newThought
- a string representing a new thoughtpublic java.lang.String toString()
toString
in class java.lang.Object