ist.palcom.resource.descriptor
Class PRDData

java.lang.Object
  extended by ist.palcom.resource.descriptor.ASTNode
      extended by ist.palcom.resource.descriptor.AbstractXMLRepresentable
          extended by ist.palcom.resource.descriptor.PRDData
All Implemented Interfaces:
IHgraphNode, XMLRepresentable, java.lang.Cloneable
Direct Known Subclasses:
AbstractServiceDecl, Action, ConnectionDecl, ConnectionDeclList, ControlInfo, DeviceDecl, DeviceDeclList, DeviceUse, EventHandlerClause, EventHandlerList, EventHandlerScript, Identifier, PalcomResourceDescriptor, PRDFunctionalMetadata, PRDSecondOrderList, ServiceDecl, ServiceDeclList, ServiceExp, Use, VariableDecl, VariableList

public abstract class PRDData
extends AbstractXMLRepresentable
implements java.lang.Cloneable, IHgraphNode


Field Summary
protected  IHgraphNode _node
           
static byte FULLY_OPERATIONAL
           
static byte NOT_OPERATIONAL
           
static byte PARTIALLY_OPERATIONAL
           
 
Fields inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
getBrowserLabel_visited
 
Fields inherited from class ist.palcom.resource.descriptor.ASTNode
CHANGE, children, encloseInBraces_visited, generatedWithCacheCycle, generatedWithCircularEnabled, generatedWithComponentCheck, getAssemblyLabel_visited, getErrorList_visited, getIndent_visited, getParentPRDAssemblyVer_visited, getPrettyClosingString_visited, getPrettyString_visited, IN_CIRCLE, LAST_CYCLE, numChildren, parent, prettyPrintChildren_visited, RESET_CYCLE
 
Fields inherited from interface ist.palcom.hgraph.IHgraphNode
CHILD_NAME_CLASH, CIRCULARITY_CLASH, COMMAND_OR_NODE_MISSING, ERROR, HANDLER_MISSING, INVOKATOR_MISSING, LISTENER_MISSING, NODE_NOT_CHILD, PATH_MISSING, SIBLING_ALREADY_EXISTS, SIBLING_NONEXISTENT, SIBLING_REFERENCE_ALREADY_EXISTS, SIBLING_REFERENCE_NONEXISTENT, STATUS_OK, VALUE_ALREADY_EXISTS, VALUE_NOT_PRESENT
 
Constructor Summary
PRDData()
           
 
Method Summary
 int addNodeChild(IHgraphNode node, Path callerPath)
          Adds a child to the node's private list of children.
 java.lang.Object clone()
           
 void flushCache()
           
 java.util.Iterator getChildIterator()
           
 FuncFunc getFuncFunc()
           
 LocalSID getLocalSID()
           
 java.lang.String getName()
           
 java.lang.String getNodeName()
           
 IHgraphNode getNodeParent()
           
 Path getPath()
           
 PRDData getPRDDataThatEquals(PRDData data)
           
 PRDData getPRDDataThatIsAboutTheSameEntityAs(PRDData data)
           
 SiblingFunc getSiblingFunc()
           
 ValueFunc getValueFunc()
           
 boolean hasChildNamed(java.lang.String name)
          Checks whether the node has a child with a given name
 boolean isAboutTheSameEntityAs(PRDData data)
           
 boolean isAncestorOf(IHgraphNode node)
          Checks whether this node is an ancestor of the parameter node.
protected  int numChildren()
           
 int removeNodeChild(java.lang.String name, Path callerPath)
          Removes a child based on its name.
protected static boolean safeEqual(java.lang.Object o1, java.lang.Object o2)
           
 void setChild(ASTNode child, int i)
           
 int setNodeName(java.lang.String name, Path callerPath)
          Sets the name of the node.
 int setNodeParent(IHgraphNode newParent, Path callerPath)
          Sets the parent of the HgraphNode.
 java.lang.String toXML()
           
 java.lang.String toXMLFull()
           
 java.lang.String toXMLFullRecursively()
           
 java.lang.String toXMLRecursively()
           
 void updatePath()
          Updates the path of the H-Graph node along with its offspring recursively.
 
Methods inherited from class ist.palcom.resource.descriptor.AbstractXMLRepresentable
addChildFromXMLElement, addToAssembly, equals, getBrowserLabel, getTagName, getXMLData, getXMLData, removeFromAssembly, toString
 
Methods inherited from class ist.palcom.resource.descriptor.ASTNode
addASTtoList, addChild, copy, Define_AbstractResourceAddress_custServiceAddress, Define_AbstractResourceAddress_provServiceAddress, Define_CommandInfo_ci, Define_Device_parentDevice, Define_Identifier_getLocalName, Define_NetworkNode_lookup, Define_PRDAssemblyVer_av, Define_Service_inhCust, Define_Service_inhProv, Define_Service_parentService, Define_String_expectedType, Define_Universe_universe, encloseInBraces, fullCopy, getAssemblyLabel, getChild, getChildArray, getChildNoTransform, getErrorList, getIDforEditing, getIndent, getIndexOfChild, getNumChild, getParent, getParentPRDAssemblyVer, getPrettyClosingString, getPrettyString, insertChild, prettyprint, prettyPrintChildren, remove, removeChild, reset, resetTree, setParent, updateIDfromEditor
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ist.palcom.xml.XMLRepresentable
initializeFromElement, writeXMLElement
 

Field Detail

_node

protected IHgraphNode _node

PARTIALLY_OPERATIONAL

public static final byte PARTIALLY_OPERATIONAL
See Also:
Constant Field Values

FULLY_OPERATIONAL

public static final byte FULLY_OPERATIONAL
See Also:
Constant Field Values

NOT_OPERATIONAL

public static final byte NOT_OPERATIONAL
See Also:
Constant Field Values
Constructor Detail

PRDData

public PRDData()
Method Detail

flushCache

public void flushCache()
Overrides:
flushCache in class AbstractXMLRepresentable

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class AbstractXMLRepresentable
Throws:
java.lang.CloneNotSupportedException

isAboutTheSameEntityAs

public boolean isAboutTheSameEntityAs(PRDData data)
Returns:
True if info and this info are for the same entity. This can be /**

getPRDDataThatEquals

public PRDData getPRDDataThatEquals(PRDData data)
Returns:
This data, if it equals data, or a contained data that equals data (i.e. contained, not only referenced by URN), or null. The implementation here just checks equals, subclasses override where needed.

getPRDDataThatIsAboutTheSameEntityAs

public PRDData getPRDDataThatIsAboutTheSameEntityAs(PRDData data)
Returns:
This data, if it is about the same entity as data, or a contained data that is about the same entity as data (i.e. contained, not only referenced by URN), or null. The implementation here just checks isAboutTheSameEntityAs, subclasses override where needed.

safeEqual

protected static boolean safeEqual(java.lang.Object o1,
                                   java.lang.Object o2)

setChild

public void setChild(ASTNode child,
                     int i)
Overrides:
setChild in class ASTNode

getNodeParent

public IHgraphNode getNodeParent()
Specified by:
getNodeParent in interface IHgraphNode
Returns:
The parent of the node. null if the parent is root

getChildIterator

public java.util.Iterator getChildIterator()
Specified by:
getChildIterator in interface IHgraphNode
Returns:
An Iterator over the children of the node

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface IHgraphNode
Returns:
The name of the node.

setNodeName

public int setNodeName(java.lang.String name,
                       Path callerPath)
Description copied from interface: IHgraphNode
Sets the name of the node. If a sibling already has the name, an error control message is returned

Specified by:
setNodeName in interface IHgraphNode
Parameters:
name - The new name
Returns:
IHgraphNode.STATUS_OK if the change succeeded. IHgraphNode.CHILD_NAME_CLASH if a sibling with the given name already exists.

getPath

public Path getPath()
Specified by:
getPath in interface IHgraphNode
Returns:
the Path object pertaining to the path of the node

updatePath

public void updatePath()
Description copied from interface: IHgraphNode
Updates the path of the H-Graph node along with its offspring recursively. The path is updated when the node name and the node parent is sat.

Specified by:
updatePath in interface IHgraphNode

hasChildNamed

public boolean hasChildNamed(java.lang.String name)
Description copied from interface: IHgraphNode
Checks whether the node has a child with a given name

Specified by:
hasChildNamed in interface IHgraphNode
Parameters:
name - The name to check
Returns:
True iff the node has an actual child with the given name. False if not.

isAncestorOf

public boolean isAncestorOf(IHgraphNode node)
Description copied from interface: IHgraphNode
Checks whether this node is an ancestor of the parameter node. It does so with a depth-first sharch of its offspring (children etc.)

Specified by:
isAncestorOf in interface IHgraphNode
Returns:
true if this node is an ancestor of the parameter node. false if not.

removeNodeChild

public int removeNodeChild(java.lang.String name,
                           Path callerPath)
Description copied from interface: IHgraphNode
Removes a child based on its name.

Specified by:
removeNodeChild in interface IHgraphNode
Parameters:
name - The name of the child to be removed
Returns:
IHgraphNode.STATUS_OK if the operation succeeds

toXML

public java.lang.String toXML()
Specified by:
toXML in interface IHgraphNode
Returns:
A simple xml'ified String of the node (type, name, path, children)

toXMLFull

public java.lang.String toXMLFull()
Specified by:
toXMLFull in interface IHgraphNode
Returns:
A complete xml'ified String of the node (same as simple + handlers, invokators, listeners, values)

toXMLRecursively

public java.lang.String toXMLRecursively()
Specified by:
toXMLRecursively in interface IHgraphNode
Returns:
A simple recursive xml'ified String of the node (type, name, path, children)

toXMLFullRecursively

public java.lang.String toXMLFullRecursively()
Specified by:
toXMLFullRecursively in interface IHgraphNode
Returns:
A complete recursive xml'ified String of the node (same as simple + handlers, invokators, listeners, values) HEAVY!!!

setNodeParent

public int setNodeParent(IHgraphNode newParent,
                         Path callerPath)
Description copied from interface: IHgraphNode
Sets the parent of the HgraphNode. This triggers a recalculation of the path of the node and its offspring

Specified by:
setNodeParent in interface IHgraphNode
Parameters:
newParent - the new parent
Returns:
IHgraphNode.STATUS_OK if the operation succeeds. IHgraphNode.CIRCULARITY_CLASH if the operation causes a circularity.

addNodeChild

public int addNodeChild(IHgraphNode node,
                        Path callerPath)
Description copied from interface: IHgraphNode
Adds a child to the node's private list of children. Ensures that names amongst children are unique

Specified by:
addNodeChild in interface IHgraphNode
Parameters:
node - The new child to be added
Returns:
IHgraphNode.STATUS_OK if the change succeeded. IHgraphNode.CHILD_NAME_CLASH if a sibling with the given name already exists.

getSiblingFunc

public SiblingFunc getSiblingFunc()
Specified by:
getSiblingFunc in interface IHgraphNode
Returns:
The SiblingFunc Sibling functionality object for the given node.

getValueFunc

public ValueFunc getValueFunc()
Specified by:
getValueFunc in interface IHgraphNode
Returns:
The ValueFunc Value functionality object for the given node.

getFuncFunc

public FuncFunc getFuncFunc()
Specified by:
getFuncFunc in interface IHgraphNode
Returns:
The FuncFunc functional functionality (ie. handlers, invokators and listeners) object for the given node.

getName

public java.lang.String getName()

getLocalSID

public LocalSID getLocalSID()
Returns:
The LocalSID of the entity described, or null if not applicable.

numChildren

protected int numChildren()
Overrides:
numChildren in class AbstractXMLRepresentable