edu.wpi.ebob.internal.inspect
Class AbstractNode

java.lang.Object
  extended by edu.wpi.ebob.internal.inspect.AbstractNode
All Implemented Interfaces:
Node
Direct Known Subclasses:
ArrayItemNode, FieldNode, InstanceNode, ReturnValueNode, RootNode

public abstract class AbstractNode
extends java.lang.Object
implements Node

Author:
Liam Morley

Field Summary
protected  java.util.List children
          the children of this node
private  Node parent
          the parent of this node
 
Constructor Summary
AbstractNode()
          constructs a new general-type node.
 
Method Summary
protected  void addChild(Node child)
          adds child as a child node of the current node, and sets its parent to this.
 Node[] getChildren()
          returns the child nodes of this node, represented as objects.
 org.eclipse.swt.graphics.Image getImage()
          returns the image that should be shown for this node.
 Node getParent()
          the parent node of this node.
 java.lang.String getValueAsString()
          returns the toString() of Node.getValue().
 boolean hasChildren()
           
 void setParent(Node parent)
          sets the parent of this node to be parent.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.wpi.ebob.internal.inspect.Node
getName, getType, getValue
 

Field Detail

children

protected java.util.List children
the children of this node


parent

private Node parent
the parent of this node

Constructor Detail

AbstractNode

public AbstractNode()
constructs a new general-type node.

Method Detail

addChild

protected void addChild(Node child)
adds child as a child node of the current node, and sets its parent to this.


getChildren

public Node[] getChildren()
Description copied from interface: Node
returns the child nodes of this node, represented as objects.

Specified by:
getChildren in interface Node
See Also:
Node.getChildren()

getParent

public Node getParent()
Description copied from interface: Node
the parent node of this node.

Specified by:
getParent in interface Node
See Also:
Node.getParent()

getValueAsString

public java.lang.String getValueAsString()
returns the toString() of Node.getValue().

Specified by:
getValueAsString in interface Node
See Also:
Node.getValueAsString()

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface Node
Returns:
true if this node has children, false otherwise.
See Also:
Node.hasChildren()

setParent

public void setParent(Node parent)
Description copied from interface: Node
sets the parent of this node to be parent.

Specified by:
setParent in interface Node
See Also:
Node.setParent(Node)

getImage

public org.eclipse.swt.graphics.Image getImage()
Description copied from interface: Node
returns the image that should be shown for this node.

Specified by:
getImage in interface Node
Returns:
null
See Also:
Node.getImage()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Node.getName().