org.jtheque.core.managers.state
Class NodeState

java.lang.Object
  extended by org.jtheque.core.managers.state.NodeState

public final class NodeState
extends java.lang.Object

A node of a state.

Author:
Baptiste Wicht

Constructor Summary
NodeState(java.lang.String name)
          Construct a new NodeState.
NodeState(java.lang.String name, java.lang.String text)
          Construct a new NodeState.
 
Method Summary
 void addSimpleChildValue(java.lang.String name, java.lang.String value)
          Add a simple child value.
 java.util.Collection<NodeStateAttribute> getAttributes()
          Return the attributes of the node.
 java.lang.String getAttributeValue(java.lang.String key)
          Return the attribute value.
 java.util.Collection<NodeState> getChildrens()
          Return the childrens of the node.
 java.lang.String getName()
          Return the name of the node.
 java.lang.String getText()
          Return the text of the node.
 boolean hasAttribute()
          Indicate if the node has attribute or not.
 boolean hasChildren()
          Indicate if the node has children or not.
 void setAttribute(java.lang.String key, java.lang.String value)
          Set an attribute.
 void setAttributes(java.util.Collection<NodeStateAttribute> attributes)
          Set the attributes of the node.
 void setChildrens(java.util.Collection<NodeState> childrens)
          Set the childrens of the node.
 void setText(java.lang.String text)
          Set the text of the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeState

public NodeState(java.lang.String name)
Construct a new NodeState.

Parameters:
name - The name of the node.

NodeState

public NodeState(java.lang.String name,
                 java.lang.String text)
Construct a new NodeState.

Parameters:
name - The name of the node.
text - The text of the node.
Method Detail

getName

public java.lang.String getName()
Return the name of the node.

Returns:
The name.

getChildrens

public java.util.Collection<NodeState> getChildrens()
Return the childrens of the node.

Returns:
A List containing all the NodeState children.

setChildrens

public void setChildrens(java.util.Collection<NodeState> childrens)
Set the childrens of the node.

Parameters:
childrens - The childrens.

addSimpleChildValue

public void addSimpleChildValue(java.lang.String name,
                                java.lang.String value)
Add a simple child value.

Parameters:
name - The name of the node.
value - The value of the node.

getText

public java.lang.String getText()
Return the text of the node.

Returns:
The text of the node.

setText

public void setText(java.lang.String text)
Set the text of the node.

Parameters:
text - The text of the node.

getAttributes

public java.util.Collection<NodeStateAttribute> getAttributes()
Return the attributes of the node.

Returns:
A List containing all the attributes.

setAttributes

public void setAttributes(java.util.Collection<NodeStateAttribute> attributes)
Set the attributes of the node.

Parameters:
attributes - A List containing all the attributes.

hasChildren

public boolean hasChildren()
Indicate if the node has children or not.

Returns:
true if the node has children else false.

hasAttribute

public boolean hasAttribute()
Indicate if the node has attribute or not.

Returns:
true if the node has attribute else false.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.String value)
Set an attribute.

Parameters:
key - The key of the attribute.
value - The value of the attribute.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String key)
Return the attribute value.

Parameters:
key - The name of the attribute.
Returns:
The value of the attribute or null if the attribute doesn't exist.


Copyright © 2009 JTheque. All Rights Reserved.