ch.tatool.core.element
Class NodeImpl

java.lang.Object
  extended by ch.tatool.core.element.AbstractPropertyHolder
      extended by ch.tatool.core.element.NodeImpl
All Implemented Interfaces:
PropertyHolder, Node
Direct Known Subclasses:
AbstractElement, AbstractPointAdaptor, AbstractPointsAndLevelHandler, BlockingExecutable, CompoundElementTrialCountEvaluator, ConfidenceRatingHandler, DefaultExecutionPauseHandler, DefaultTimeoutHandler, DefaultTrialCountEvaluator, DefaultVisualTimeoutHandler, EscapeKeyEventHandler, ExecutionFeedbackHandler, NonBlockingAWTExecutable, StatusPanelStateHandler, TrialCountHandler, UserFeedbackLevelListener

public class NodeImpl
extends AbstractPropertyHolder
implements Node

Default node implementation. Provides helper methods to assign a parent as well as support for id chaining where the id is "{parentId}.{localId}"

Author:
Michael Ruflin

Constructor Summary
NodeImpl()
           
NodeImpl(String defaultId)
           
 
Method Summary
protected static void assignParent(Node parent, Collection<Object> objects)
          Sets the parent to the provided objects if they are of type Node
protected static void assignParent(Node parent, Object object)
          Sets the parent to the provided object if the object is type Node
protected static void assignParents(Node parent, Collection<Element> objects)
          Sets the parent to the provided objects if they are of type Node
 String getId()
          Unique id of the element.
 String getLocalId()
           
 Node getParent()
           
 void setId(String id)
           
 void setLocalId(String id)
           
 void setParent(Node parent)
           
 
Methods inherited from class ch.tatool.core.element.AbstractPropertyHolder
clearProperties, getKeys, getProperty, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.tatool.data.PropertyHolder
clearProperties, getKeys, getProperty, removeProperty, setProperty
 

Constructor Detail

NodeImpl

public NodeImpl()

NodeImpl

public NodeImpl(String defaultId)
Method Detail

setId

public void setId(String id)

getLocalId

public String getLocalId()

setLocalId

public void setLocalId(String id)

getId

public String getId()
Unique id of the element. This includes the localId of the parent elements as well and has to be unique in a element/handler tree

Specified by:
getId in interface PropertyHolder

getParent

public Node getParent()
Specified by:
getParent in interface Node

setParent

public void setParent(Node parent)
Specified by:
setParent in interface Node

assignParent

protected static void assignParent(Node parent,
                                   Object object)
Sets the parent to the provided object if the object is type Node


assignParent

protected static void assignParent(Node parent,
                                   Collection<Object> objects)
Sets the parent to the provided objects if they are of type Node


assignParents

protected static void assignParents(Node parent,
                                    Collection<Element> objects)
Sets the parent to the provided objects if they are of type Node



Copyright © 2012. All Rights Reserved.