|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.huguesjohnson.tiamat.ItemCollection
public class ItemCollection
ItemCollection - used to store a collection of items
Constructor Summary | |
---|---|
ItemCollection()
Default constructor, uses default pathDelimiter. |
|
ItemCollection(Item[] items)
Create a new ItemCollection based off an array of Items with a the default path delimiter. |
|
ItemCollection(Item[] items,
java.lang.String pathDelimiter)
Create a new ItemCollection based off an array of Items with a the default path delimiter. |
|
ItemCollection(java.lang.String pathDelimiter)
Create a new ItemCollection with a custom path delimiter. |
Method Summary | |
---|---|
Item[] |
getAll()
Returns all Items in the collection. |
int |
getCount()
Returns the total number of Items in the collection. |
int |
getCount(java.lang.String path)
Returns the total number of Items starting from the specified path. |
Item |
getItem(java.lang.String path)
Returns the Item with the specified path if it exists, otherwise null. |
ItemCollection |
getModifiersFor(java.lang.String targetPath)
Returns a collection of all equipped Items that have a target with a name equal to targetPath. |
int |
getNetModification(java.lang.String targetPath)
This method is used to get all the modifiers for a target and return the sum of their values. |
boolean |
removeItem(java.lang.String path)
Removes the Item with the specified path. |
void |
setItem(java.lang.String path,
Item item)
Sets the Item with the specified path, adds it if it doesn't exist. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ItemCollection()
public ItemCollection(java.lang.String pathDelimiter)
pathDelimiter
- The new path delimiter to use.public ItemCollection(Item[] items)
items
- The initial set of items to add to the collection.public ItemCollection(Item[] items, java.lang.String pathDelimiter)
items
- The initial set of Items to add to the collection.pathDelimiter
- The new path delimiter to use.Method Detail |
---|
public boolean removeItem(java.lang.String path)
path
- The path of the Item to remove.
public Item getItem(java.lang.String path)
path
- The path of the Item to retreive.
public void setItem(java.lang.String path, Item item)
path
- The path of the Item to set.item
- The Item to set.public int getCount()
public int getCount(java.lang.String path)
path
- The starting path to count from.
public ItemCollection getModifiersFor(java.lang.String targetPath)
targetPath
- The target name to look for.
public int getNetModification(java.lang.String targetPath)
targetPath
- The target name to look for.
public Item[] getAll()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |