Class Thing

java.lang.Object
  extended by Thing
Direct Known Subclasses:
Creature

public class Thing
extends java.lang.Object

Thing is the top of a class hierarchy. All Things have a name, given to them at birth. Once born, they cannot change their name. Things have no behavior other than producing their string representation.

Since:
2007

Constructor Summary
Thing(java.lang.String name)
           
 
Method Summary
 java.lang.String toString()
          Produce a String description of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Thing

public Thing(java.lang.String name)
Parameters:
name - -- the given name of this Thing
Method Detail

toString

public java.lang.String toString()
Produce a String description of this instance. If the class of the instance is Thing, then return only the name of the Thing. Otherwise add the name of the class after the name of the thing, separated by a space. this makes the class name of the thing serve as the thing's last name (surname), and the given name of the thing is its first name (given name).

Overrides:
toString in class java.lang.Object
Returns:
the description of this instance