Class Brain

java.lang.Object
  extended by Brain

public class Brain
extends java.lang.Object

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

Brain

public Brain()
Creates a new brain

Method Detail

getAwake

public boolean getAwake()
Returns whether organism is awake or not

Returns:
true if organism is awake, false otherwise

getThought

public java.lang.String getThought()
Returns the current thought

Returns:
a string representing current thought

setAwake

public void setAwake(boolean newStatus)
Set the status of the brain to awake or asleep

Parameters:
newStatus - true if awake anad false if asleep

setThought

public void setThought(java.lang.String newThought)
Update thought

Parameters:
newThought - a string representing a new thought

toString

public java.lang.String toString()
Returns a string representation of the brain

Overrides:
toString in class java.lang.Object
Returns:
a string representing the state of the brain