|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectItem
public class Item extends java.lang.Object
Item.java - Item stuff.
Modifier and Type | Class and Description |
---|---|
static class |
Item.Type
Type - Used to identify items |
Modifier and Type | Field and Description |
---|---|
Item.Type |
itemType
|
Constructor and Description |
---|
Item()
Create an item with an id of 1 and amount of 1 |
Item(int itemId,
int amount)
Creates an item with specified id and amount |
Item(int itemId,
int amount,
int slot)
Creates an item with specified id, amount and slot |
Item(Item.Type itemType)
Create a new item. |
Item(Item.Type itemType,
int amount)
|
Item(jl hn)
Creates an item from the actual item class |
Item(jl hn,
int slot)
Creates an item from the actual item class at the given slot |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Tests the given object to see if it equals this object |
int |
getAmount()
Returns the amount |
int |
getDamage()
Returns this item's current damage. |
int |
getItemId()
Returns the item id |
int |
getSlot()
Returns this item's current slot. |
Item.Type |
getType()
Returns this item type |
int |
hashCode()
Returns a semi-unique hashcode for this object |
static boolean |
isValidItem(int itemId)
Returns true if specified item id is a valid item id. |
void |
setAmount(int amount)
Sets the amount |
void |
setDamage(int damage)
Sets this item's damage |
void |
setItemId(int itemId)
Sets item id to specified id |
void |
setSlot(int slot)
Sets this item's slot |
void |
setType(Item.Type itemType)
Set the item type |
java.lang.String |
toString()
Returns a String value representing this object |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Item.Type itemType
Constructor Detail |
---|
public Item()
public Item(Item.Type itemType)
itemType
- type of item.public Item(Item.Type itemType, int amount)
public Item(int itemId, int amount)
itemId
- amount
- public Item(int itemId, int amount, int slot)
itemId
- amount
- slot
- public Item(jl hn)
hn
- public Item(jl hn, int slot)
hn
- slot
- Method Detail |
---|
public int getItemId()
public void setItemId(int itemId)
itemId
- public int getAmount()
public void setAmount(int amount)
amount
- public static boolean isValidItem(int itemId)
itemId
- public int getSlot()
public void setSlot(int slot)
slot
- public int getDamage()
public void setDamage(int damage)
damage
- public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to testpublic int hashCode()
hashCode
in class java.lang.Object
public Item.Type getType()
public void setType(Item.Type itemType)
itemType
- the item type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |