Class Item

java.lang.Object
  extended by Item
Direct Known Subclasses:
BonusItem

public class Item
extends Object

Represents an item which can be used by a player

Version:
1.0

Constructor Summary
Item(String description)
          Constructor for objects of type Item
 
Method Summary
 boolean equals(Object o)
          Returns true if this object and the object under test have the same value in the description property.
 String getDescription()
          Returns the description of the item
 void setDescription(String description)
          Sets the value of description
 String toString()
          Returns a String representation of this object
 void use()
          Use the item
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Item

public Item(String description)
Constructor for objects of type Item

Parameters:
description - value for the description
Method Detail

equals

public boolean equals(Object o)
Returns true if this object and the object under test have the same value in the description property. Modify this method if you want to define equality differently

Overrides:
equals in class Object
Parameters:
o - the object to be tested for equality with this one
Returns:
true or false

getDescription

public String getDescription()
Returns the description of the item

Returns:
the description

setDescription

public void setDescription(String description)
Sets the value of description

Parameters:
description - the new value of description

toString

public String toString()
Returns a String representation of this object

Overrides:
toString in class Object
Returns:
a String represention of this object

use

public void use()
Use the item