story.dbcore.parameters
Class NodeInstancing

java.lang.Object
  extended by story.dbcore.parameters.NodeInstancing

public class NodeInstancing
extends java.lang.Object

A NodeInstancing is a data structure that contains pointers to a node and a set of arguments for that node, and semantically represents the "plugging in" of the arguments for the node's ParameterSet attribute. For example, isGreen(grass) is a NodeInstancing and represents the plugging in of node [grass] into a ParameterSet attribute of node [isGreen]. (Typically the "expansion" parameter is used, but any can be used for this class.)

This class contains functions to test the validity of a NodeInstancing (e.g., whether isGreen(grass) is a valid relationship according to the rules of isGreen).

This object takes a Document object as a construction parameter, even though it is passed around outside a DBCoreInterface. This is okay because the Document is only used during construction, and then passes out of scope.


Constructor Summary
NodeInstancing(GenericNode frameNode, AttributeID parameterAttribute, ArgumentVector arguments)
          Constructs a NodeInstancing.
 
Method Summary
 boolean equals(NodeInstancing other)
          Test the equivalence of one NodeInstancing to another.
 ArgumentVector getArguments()
          Retrieve the arguments.
 AttributeID getAttribute()
           
 NodeAddress getFrameNode()
           
 AttributeID getParameterAttribute()
          Return the AttributeID of the attribute of the frame used as the parameter for instancing.
 NodeInstancing intern()
          Create an "interned" version of this NodeInstancing, i.e., one that uses NodeAddresses rather than GenericNodes.
 boolean isInterned()
          Returns whether this NodeInstancing is interned.
 java.lang.StringBuffer render()
          Render the NodeInstancing to a StringBuffer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeInstancing

public NodeInstancing(GenericNode frameNode,
                      AttributeID parameterAttribute,
                      ArgumentVector arguments)
               throws Scheherexception
Constructs a NodeInstancing. Does not validate.

Throws:
Scheherexception
Method Detail

getAttribute

public AttributeID getAttribute()

getFrameNode

public NodeAddress getFrameNode()
                         throws Scheherexception
Throws:
Scheherexception

getArguments

public ArgumentVector getArguments()
                            throws Scheherexception
Retrieve the arguments. Guaranteed non-null (NodeInstancings constructed with null ArgumentVectors are given 0-size ArgumentVectors in Document).

Throws:
Scheherexception

getParameterAttribute

public AttributeID getParameterAttribute()
Return the AttributeID of the attribute of the frame used as the parameter for instancing.


render

public java.lang.StringBuffer render()
                              throws Scheherexception
Render the NodeInstancing to a StringBuffer.

Throws:
Scheherexception

equals

public boolean equals(NodeInstancing other)
               throws Scheherexception
Test the equivalence of one NodeInstancing to another.

Throws:
Scheherexception

intern

public NodeInstancing intern()
                      throws Scheherexception
Create an "interned" version of this NodeInstancing, i.e., one that uses NodeAddresses rather than GenericNodes. These are necessary for maintaining the integrity of a memento (command history) when nodes are renamed after they are mentioned in a NodeInstancing.

Throws:
Scheherexception

isInterned

public boolean isInterned()
Returns whether this NodeInstancing is interned.



Copyright © 2011 David K. Elson. All Rights Reserved.