|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.ItemDesc
This class encapsulates an item description, including the string description and the item number. When a user types "get key 3", "key" is the string description and the item number is 3. Used by commands that have to know about such things.
Field Summary | |
protected java.lang.String |
desc_
|
protected int |
number_
|
Constructor Summary | |
ItemDesc(java.lang.String desc,
int num)
Constructs a new ItemDesc |
Method Summary | |
java.lang.String |
getDescription()
Returns the description parsed from getItemNumber(). |
int |
getItemNumber()
Returns the item number parsed from getItemNumber(). |
static ItemDesc |
getItemNumber(java.lang.String desc)
Returns an ItemDesc for this item, if needed. |
static Predicate |
getNameMatchPredicate(java.lang.String desc)
Takes an object description and returns a predicate suitable for finding it. |
static void |
main(java.lang.String[] args)
Used for testing only. |
void |
setDescription(java.lang.String desc)
Sets a new description for this ItemDesc. |
void |
setItemNumber(int num)
Sets the item number for this ItemDesc. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int number_
protected java.lang.String desc_
Constructor Detail |
public ItemDesc(java.lang.String desc, int num)
desc
- the description, without the item numbernum
- the item number, a positive integer.Method Detail |
public void setItemNumber(int num)
num
- a positive integerpublic int getItemNumber()
public java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc
- the new descriptionpublic static ItemDesc getItemNumber(java.lang.String desc)
desc
- the item description
public static Predicate getNameMatchPredicate(java.lang.String desc)
desc
- an object description, which may or may not have
an item number at the end.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |