com.sdm.quasar.client.core.common.sysinfo
Class DefaultSystemInfoNode

java.lang.Object
  extended bycom.sdm.quasar.client.core.common.sysinfo.DefaultSystemInfoNode
All Implemented Interfaces:
SystemInfoNode

public class DefaultSystemInfoNode
extends java.lang.Object
implements SystemInfoNode

A simple implementation of SystemInfoNode.

Version:
1.$Revision$
Author:
Thomas Wolf

Field Summary
 
Fields inherited from interface com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode
ID_ATTRIBUTE, ID_REF_ATTRIBUTE, VALUE_ATTRIBUTE
 
Constructor Summary
DefaultSystemInfoNode(java.lang.String type)
          Creates a new DefaultSystemInfoNode.
 
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 (SystemInfoNode.ID_ATTRIBUTE value.
 java.lang.String getIdRef()
          Returns the id attribute (SystemInfoNode.ID_REF_ATTRIBUTE value.
 java.lang.String getType()
          Returns the type of this SystemInfoNode.
 java.lang.String getValue()
          Returns the id attribute (SystemInfoNode.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 (SystemInfoNode.ID_ATTRIBUTE to the given value.
 void setIdRef(java.lang.String value)
          Sets the id-ref attribute (SystemInfoNode.ID_REF_ATTRIBUTE to the given value.
 void setValue(java.lang.String value)
          Sets the value attribute (SystemInfoNode.VALUE_ATTRIBUTE to the given value.
 java.lang.String toString()
           
protected  java.lang.String toString(java.lang.String ident)
          Returns the string representation of the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultSystemInfoNode

public DefaultSystemInfoNode(java.lang.String type)
Creates a new DefaultSystemInfoNode.

Method Detail

getType

public java.lang.String getType()
Description copied from interface: SystemInfoNode
Returns the type of this SystemInfoNode.

Specified by:
getType in interface SystemInfoNode
See Also:
SystemInfoNode.getType()

getChildCount

public int getChildCount()
Description copied from interface: SystemInfoNode
Returns the number of child SystemInformationNodes of this one.

Specified by:
getChildCount in interface SystemInfoNode
See Also:
SystemInfoNode.getChildCount()

getChild

public SystemInfoNode getChild(int index)
Description copied from interface: SystemInfoNode
Returns the child SystemInfoNode at the given index.

Specified by:
getChild in interface SystemInfoNode
Parameters:
index - the child index (0 to SystemInfoNode.getChildCount(); order like created)
Returns:
the child SystemInfoNode at the given index
See Also:
SystemInfoNode.getChild(int)

createChild

public SystemInfoNode createChild(java.lang.String type)
Description copied from interface: SystemInfoNode
Creates a new child SystemInfoNode with the given type.

Specified by:
createChild in interface SystemInfoNode
Parameters:
type - the type of the SystemInfoNode to create
Returns:
the new created SystemInfoNode
See Also:
SystemInfoNode.createChild(java.lang.String)

remove

public void remove()
Description copied from interface: SystemInfoNode
Removes this SystemInfoNode from it's parent.

Specified by:
remove in interface SystemInfoNode
See Also:
SystemInfoNode.remove()

getAttributeCount

public int getAttributeCount()
Description copied from interface: SystemInfoNode
Returns the number of attributes of this SystemInfoNode.

Specified by:
getAttributeCount in interface SystemInfoNode
See Also:
SystemInfoNode.getAttributeCount()

getAllAttributes

public java.lang.String[] getAllAttributes()
Description copied from interface: SystemInfoNode
Returns an array with all attribute names.

Specified by:
getAllAttributes in interface SystemInfoNode
See Also:
SystemInfoNode.getAllAttributes()

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Description copied from interface: SystemInfoNode
Returns the attribute value of the attribute with the given name.

Specified by:
getAttribute in interface SystemInfoNode
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.
See Also:
SystemInfoNode.getAttribute(java.lang.String)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Description copied from interface: SystemInfoNode
Defines the attribute value of the attribute with the given name.

Specified by:
setAttribute in interface SystemInfoNode
Parameters:
name - the name of the attribute
value - the attribute value of the attribute with the given name.
See Also:
SystemInfoNode.setAttribute(java.lang.String, java.lang.String)

getId

public java.lang.String getId()
Description copied from interface: SystemInfoNode
Returns the id attribute (SystemInfoNode.ID_ATTRIBUTE value.

Specified by:
getId in interface SystemInfoNode
See Also:
SystemInfoNode.getId()

setId

public void setId(java.lang.String value)
Description copied from interface: SystemInfoNode
Sets the id attribute (SystemInfoNode.ID_ATTRIBUTE to the given value.

Specified by:
setId in interface SystemInfoNode
Parameters:
value - the value to set
See Also:
SystemInfoNode.setId(java.lang.String)

getIdRef

public java.lang.String getIdRef()
Description copied from interface: SystemInfoNode
Returns the id attribute (SystemInfoNode.ID_REF_ATTRIBUTE value.

Specified by:
getIdRef in interface SystemInfoNode
See Also:
SystemInfoNode.getIdRef()

setIdRef

public void setIdRef(java.lang.String value)
Description copied from interface: SystemInfoNode
Sets the id-ref attribute (SystemInfoNode.ID_REF_ATTRIBUTE to the given value.

Specified by:
setIdRef in interface SystemInfoNode
Parameters:
value - the value to set
See Also:
SystemInfoNode.setIdRef(java.lang.String)

getValue

public java.lang.String getValue()
Description copied from interface: SystemInfoNode
Returns the id attribute (SystemInfoNode.VALUE_ATTRIBUTE value.

Specified by:
getValue in interface SystemInfoNode
See Also:
SystemInfoNode.getValue()

setValue

public void setValue(java.lang.String value)
Description copied from interface: SystemInfoNode
Sets the value attribute (SystemInfoNode.VALUE_ATTRIBUTE to the given value.

Specified by:
setValue in interface SystemInfoNode
Parameters:
value - the value to set
See Also:
SystemInfoNode.setValue(java.lang.String)

findChildById

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

Specified by:
findChildById in interface SystemInfoNode
Parameters:
id - the id to look for (see SystemInfoNode.setId(String))
deep - if true, search whole subtree
Returns:
the SystemInfoNode with the id or null, if not found
See Also:
SystemInfoNode.findChildById(java.lang.String, boolean)

toString

public java.lang.String toString()
See Also:
Object.toString()

toString

protected java.lang.String toString(java.lang.String ident)
Returns the string representation of the element.

Parameters:
ident - the ident string used for hierarchical representation.