bot
Class Box

java.lang.Object
  extended bybot.Thing
      extended bybot.Box
All Implemented Interfaces:
Cloneable, Serializable

public class Box
extends Thing

Holds other objects--used to illustrate casting to get to the take() method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class bot.Thing
name, owner
 
Constructor Summary
Box()
          Make an empty box.
Box(Thing con)
          Make box with "con" in it.
 
Method Summary
 String examine()
          Describe the thing.
 String pictureName()
          This is the graphic that should be used to render the thing on the screen.
 Thing take()
          Take the contents out of the box.
 String use()
          All things can be used.
 double weight()
          Boxes weigh 5 plus whatever is inside them.
 
Methods inherited from class bot.Thing
claim, clone, getName, getOwner, nudge, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Box

public Box(Thing con)
Make box with "con" in it.


Box

public Box()
Make an empty box.

Method Detail

take

public Thing take()
Take the contents out of the box. Removes contents.


use

public String use()
Description copied from class: Thing
All things can be used.

Overrides:
use in class Thing
Returns:
A string describing what happened, or returning any info about the use.

examine

public String examine()
Description copied from class: Thing
Describe the thing.

Overrides:
examine in class Thing
Returns:
A string which is a human-readable description of the thing.

pictureName

public String pictureName()
Description copied from class: Thing
This is the graphic that should be used to render the thing on the screen.

Overrides:
pictureName in class Thing

weight

public double weight()
Boxes weigh 5 plus whatever is inside them.

Overrides:
weight in class Thing