com.accountingenhancements.treearray
Class Leaf<E>

java.lang.Object
  extended by com.accountingenhancements.treearray.Leaf<E>

public class Leaf<E>
extends java.lang.Object

Leaf values and attributes


Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.Object> attributes
           
protected  E leafValue
           
 
Constructor Summary
Leaf(E value)
          Creates a new instance of Leaf
Leaf(E value, java.lang.String attribute, java.lang.Object attributeValue)
          Creates a new instance of Leaf with an initial attribute
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attribute)
          Get the value of a previously set attributre
 E getLeaf()
           
 Leaf<E> setAttribute(java.lang.String attribute, java.lang.Object value)
          Set an attribute relating to this leaf
 void setLeaf(E value)
          Replace the value in the leaf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leafValue

protected transient E leafValue

attributes

protected transient java.util.HashMap<java.lang.String,java.lang.Object> attributes
Constructor Detail

Leaf

public Leaf(E value)
Creates a new instance of Leaf

Parameters:
value - the value to assign the new leaf

Leaf

public Leaf(E value,
            java.lang.String attribute,
            java.lang.Object attributeValue)
Creates a new instance of Leaf with an initial attribute

Parameters:
value - the value to assign the new leaf
attribute - an attribute name
attributeValue - an attribute value
Method Detail

setLeaf

public void setLeaf(E value)
Replace the value in the leaf

Parameters:
value - the new leaf value

getLeaf

public E getLeaf()
Returns:
the new leaf value

setAttribute

public Leaf<E> setAttribute(java.lang.String attribute,
                            java.lang.Object value)
Set an attribute relating to this leaf

Parameters:
attribute - the name of the attribute
value - the value of the attribute
Returns:
this leaf so you can chain setAttributes.

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
Get the value of a previously set attributre

Parameters:
attribute - the name of the attribute
Returns:
the value of the attribute