edu.wpi.ebob.internal.inspect
Class ArrayItemNode

java.lang.Object
  extended by edu.wpi.ebob.internal.inspect.AbstractNode
      extended by edu.wpi.ebob.internal.inspect.ArrayItemNode
All Implemented Interfaces:
ModifiableNode, Node

public class ArrayItemNode
extends AbstractNode
implements ModifiableNode

Author:
Liam Morley

Field Summary
private  IArray array
           
private  boolean hasCheckedForChildren
           
private  int index
           
private  IClass type
           
private  IObject value
           
 
Fields inherited from class edu.wpi.ebob.internal.inspect.AbstractNode
children
 
Constructor Summary
ArrayItemNode(IArray valArray, int index, IClass type)
           
 
Method Summary
 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.
 java.lang.String getName()
          the text label for this node.
 IClass getType()
          returns the Class object associated with this node.
 IObject getValue()
          the underlying value for this node.
 java.lang.String getValueAsString()
          returns the toString() of Node.getValue().
 boolean hasChildren()
           
 boolean isModifiable()
           
 void setValue(IObject newValue)
           
 
Methods inherited from class edu.wpi.ebob.internal.inspect.AbstractNode
addChild, getParent, setParent, 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
getParent, setParent
 

Field Detail

hasCheckedForChildren

private boolean hasCheckedForChildren

index

private int index

type

private IClass type

value

private IObject value

array

private IArray array
Constructor Detail

ArrayItemNode

public ArrayItemNode(IArray valArray,
                     int index,
                     IClass type)
Method Detail

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
Overrides:
getChildren in class AbstractNode
See Also:
Node.getChildren()

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
Overrides:
getImage in class AbstractNode
Returns:
the parent node's icon
See Also:
Node.getImage()

getName

public java.lang.String getName()
Description copied from interface: Node
the text label for this node.

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

getType

public IClass getType()
Description copied from interface: Node
returns the Class object associated with this node.

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

getValue

public IObject getValue()
Description copied from interface: Node
the underlying value for this node.

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

getValueAsString

public java.lang.String getValueAsString()
Description copied from class: AbstractNode
returns the toString() of Node.getValue().

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

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface Node
Overrides:
hasChildren in class AbstractNode
Returns:
true if the object is non-null and any of the following are true:
  1. the object is an array with a length greater than 0
  2. the object is not-primitive and has at least one declared field
See Also:
Node.hasChildren()

isModifiable

public boolean isModifiable()
Specified by:
isModifiable in interface ModifiableNode
Returns:
true if and only if this object can be modified.
See Also:
ModifiableNode.isModifiable()

setValue

public void setValue(IObject newValue)
Specified by:
setValue in interface ModifiableNode
See Also:
ModifiableNode.setValue(IObject)