name.alessiosaltarin.utils
Class XmlLeaf

java.lang.Object
  extended by name.alessiosaltarin.utils.XmlLeaf
All Implemented Interfaces:
java.lang.Cloneable

public class XmlLeaf
extends java.lang.Object
implements java.lang.Cloneable

XMLLeaf: metadata container type. A lead is composed by:


IE:
Category: Shield
Container: (Small Shield, 30$), (Large Shield, 34$)

Author:
Alessio Saltarin

Constructor Summary
XmlLeaf(java.lang.String cCategoria)
          Constructs a new XML leaf.
 
Method Summary
 void addValue(java.lang.String name, java.lang.String value)
          Add name/value pair to current leaf.
 java.lang.Object clone()
          Clone this leaf
 java.lang.String getCategory()
          Get category of this leaf.
 double getDoubleValue(java.lang.String name)
          Get value associated to a particular item (name)
 int getIntValue(java.lang.String name)
          Get value associated to a particular item (name)
 java.util.Set<java.lang.String> getNames()
          Get container of items for this leaf.
 java.lang.String getValue(java.lang.String name)
          Get value associated to a particular item (name)
 java.lang.String toString()
          Long description of leaf (category and values)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlLeaf

public XmlLeaf(java.lang.String cCategoria)
Constructs a new XML leaf.

Parameters:
cCategoria - name of category
Method Detail

addValue

public void addValue(java.lang.String name,
                     java.lang.String value)
Add name/value pair to current leaf.

Parameters:
name - name of current item
value - value of current item

getValue

public java.lang.String getValue(java.lang.String name)
Get value associated to a particular item (name)

Parameters:
name - name of current item
Returns:
value (String)

getIntValue

public int getIntValue(java.lang.String name)
Get value associated to a particular item (name)

Parameters:
name - name of current item
Returns:
value (int)

getDoubleValue

public double getDoubleValue(java.lang.String name)
Get value associated to a particular item (name)

Parameters:
name - name of current item
Returns:
value (double)

getNames

public java.util.Set<java.lang.String> getNames()
Get container of items for this leaf.

Returns:
items in this leaf (Set)

getCategory

public java.lang.String getCategory()
Get category of this leaf.

Returns:
category name

clone

public java.lang.Object clone()
Clone this leaf

Overrides:
clone in class java.lang.Object
Returns:
cloned leaf

toString

public java.lang.String toString()
Long description of leaf (category and values)

Overrides:
toString in class java.lang.Object

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net