Class Item

java.lang.Object
  |
  +--Item
Direct Known Subclasses:
MonsterBallItem, PotionItem

public abstract class Item
extends java.lang.Object

Abstract class to represent an Item.

See Also:
MonsterBallItem, PotionItem, People

Field Summary
protected  int brand
          The brand of Item this is.
static int MONSTERBALL
          Brand of MonsterBall
protected  java.lang.String name
          The name of this Item
protected  int number
          The number amount of this that the People has.
static int POTION
          Brand of Potion
 
Constructor Summary
Item()
           
 
Method Summary
 void addItem()
          Adds another of this.
 boolean equals(Item i)
          Determines if there is equality
 boolean equals(java.lang.Object o)
          Determines if there is equality
 int getBrand()
          Gets the Brand of this.
 int getItemCount()
          Gets the number of this there is
 java.lang.String getName()
          Gets the name of this Item.
abstract  int getSubBrand()
          Gets the subBrand of this defined in PotionItem and MonsterBallItem
 void setItemCount(int ic)
          Sets the number of this there is.
 void setName(java.lang.String nn)
          Sets the name of this Item.
abstract  boolean useItem(Monster m)
          Uses the item on the Monster Specified
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONSTERBALL

public static final int MONSTERBALL
Brand of MonsterBall

See Also:
Constant Field Values

POTION

public static final int POTION
Brand of Potion

See Also:
Constant Field Values

name

protected java.lang.String name
The name of this Item


number

protected int number
The number amount of this that the People has.


brand

protected int brand
The brand of Item this is.

Constructor Detail

Item

public Item()
Method Detail

setName

public void setName(java.lang.String nn)
Sets the name of this Item.

Parameters:
nn - the New Name of this.

getName

public java.lang.String getName()
Gets the name of this Item.

Returns:
the name of this Item

addItem

public void addItem()
Adds another of this.


setItemCount

public void setItemCount(int ic)
Sets the number of this there is.

Parameters:
ic - the new Item Count

getItemCount

public int getItemCount()
Gets the number of this there is

Returns:
the number of this that are available

useItem

public abstract boolean useItem(Monster m)
Uses the item on the Monster Specified

Parameters:
m - the Monster to use the Item on

getBrand

public int getBrand()
Gets the Brand of this.

Returns:
th Brand of this as defined above.

getSubBrand

public abstract int getSubBrand()
Gets the subBrand of this defined in PotionItem and MonsterBallItem

Returns:
the sub Brand of this.
See Also:
MonsterBallItem, PotionItem

equals

public boolean equals(java.lang.Object o)
Determines if there is equality

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to compare to
Returns:
true iff they represent the same Item

equals

public boolean equals(Item i)
Determines if there is equality

Parameters:
i - the Item to compare to
Returns:
true iff they represent the same Item, ie have the same Name