com.sdm.quasar.client.core.common.sysinfo
Interface SystemInfoNode

All Known Implementing Classes:
DefaultSystemInfoNode

public interface SystemInfoNode

A node of a system information hierarchy. Because the main purpose of this class is to build a system information tree upon internal knowledge, this class has no methods to read the tree itself. It is only possible to read local information of a node which was given or created by the user.

Author:
Thomas Wolf

Field Summary
static java.lang.String ID_ATTRIBUTE
          Special attribute: An id for the described element.
static java.lang.String ID_REF_ATTRIBUTE
          Special attribute: A reference as id of another element.
static java.lang.String VALUE_ATTRIBUTE
          Special attribute: The value of the described element.
 
Method Summary
 SystemInfoNode createChild(java.lang.String type)
          Creates a new child SystemInfoNode with the given type.
 SystemInfoNode findChildById(java.lang.String id, boolean deep)
          Returns the child SystemInfoNode for the id given.
 java.lang.String[] getAllAttributes()
          Returns an array with all attribute names.
 java.lang.String getAttribute(java.lang.String name)
          Returns the attribute value of the attribute with the given name.
 int getAttributeCount()
          Returns the number of attributes of this SystemInfoNode.
 SystemInfoNode getChild(int index)
          Returns the child SystemInfoNode at the given index.
 int getChildCount()
          Returns the number of child SystemInformationNodes of this one.
 java.lang.String getId()
          Returns the id attribute (ID_ATTRIBUTE value.
 java.lang.String getIdRef()
          Returns the id attribute (ID_REF_ATTRIBUTE value.
 java.lang.String getType()
          Returns the type of this SystemInfoNode.
 java.lang.String getValue()
          Returns the id attribute (VALUE_ATTRIBUTE value.
 void remove()
          Removes this SystemInfoNode from it's parent.
 void setAttribute(java.lang.String name, java.lang.String value)
          Defines the attribute value of the attribute with the given name.
 void setId(java.lang.String value)
          Sets the id attribute (ID_ATTRIBUTE to the given value.
 void setIdRef(java.lang.String value)
          Sets the id-ref attribute (ID_REF_ATTRIBUTE to the given value.
 void setValue(java.lang.String value)
          Sets the value attribute (VALUE_ATTRIBUTE to the given value.
 

Field Detail

ID_ATTRIBUTE

public static final java.lang.String ID_ATTRIBUTE
Special attribute: An id for the described element.

See Also:
Constant Field Values

ID_REF_ATTRIBUTE

public static final java.lang.String ID_REF_ATTRIBUTE
Special attribute: A reference as id of another element.

See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final java.lang.String VALUE_ATTRIBUTE
Special attribute: The value of the described element.

See Also:
Constant Field Values
Method Detail

getType

public java.lang.String getType()
Returns the type of this SystemInfoNode.


remove

public void remove()
Removes this SystemInfoNode from it's parent.


createChild

public SystemInfoNode createChild(java.lang.String type)
Creates a new child SystemInfoNode with the given type.

Parameters:
type - the type of the SystemInfoNode to create
Returns:
the new created SystemInfoNode

getChildCount

public int getChildCount()
Returns the number of child SystemInformationNodes of this one.


getChild

public SystemInfoNode getChild(int index)
Returns the child SystemInfoNode at the given index.

Parameters:
index - the child index (0 to getChildCount(); order like created)
Returns:
the child SystemInfoNode at the given index
Throws:
java.lang.IllegalArgumentException - if the index is invalid

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns the attribute value of the attribute with the given name.

Parameters:
name - the name of the attribute
Returns:
the attribute value of the attribute with the given name or null, if no attribute with the given name exists.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Defines the attribute value of the attribute with the given name.

Parameters:
name - the name of the attribute
value - the attribute value of the attribute with the given name.

getAllAttributes

public java.lang.String[] getAllAttributes()
Returns an array with all attribute names.


setId

public void setId(java.lang.String value)
Sets the id attribute (ID_ATTRIBUTE to the given value.

Parameters:
value - the value to set

getId

public java.lang.String getId()
Returns the id attribute (ID_ATTRIBUTE value.


setIdRef

public void setIdRef(java.lang.String value)
Sets the id-ref attribute (ID_REF_ATTRIBUTE to the given value.

Parameters:
value - the value to set

getIdRef

public java.lang.String getIdRef()
Returns the id attribute (ID_REF_ATTRIBUTE value.


setValue

public void setValue(java.lang.String value)
Sets the value attribute (VALUE_ATTRIBUTE to the given value.

Parameters:
value - the value to set

getValue

public java.lang.String getValue()
Returns the id attribute (VALUE_ATTRIBUTE value.


getAttributeCount

public int getAttributeCount()
Returns the number of attributes of this SystemInfoNode.


findChildById

public SystemInfoNode findChildById(java.lang.String id,
                                    boolean deep)
Returns the child SystemInfoNode for the id given. If deep is true, this method will search the whole subtree.

Parameters:
id - the id to look for (see setId(String))
deep - if true, search whole subtree
Returns:
the SystemInfoNode with the id or null, if not found