gov.sns.xal.model.gen.ptree
Class ProxyNode

java.lang.Object
  |
  +--gov.sns.xal.model.gen.ptree.ProxyNode
Direct Known Subclasses:
DriftSpace, HardwareProxy, ProxyTree

public abstract class ProxyNode
extends java.lang.Object

Abstract base class for any proxy-tree node. A proxy tree is part of the automatic model lattice generation. It is based upon a nested tree representation of the machine hardware. The leaves of the proxy tree represention hardware components, or subcomponents, that may be modeled. The derived class ProxyTree represents the root node of the the proxy tree, or the root of a sub-tree within a tree. Each node in the tree maintains an interval of the beam path for which its represented hardware (by derived classes) occupies. It also maintains an ordered list of any child nodes.


Constructor Summary
ProxyNode()
           
 
Method Summary
 java.util.Iterator childIterator()
          Get an iterator object which iterates through all the direct children of this node.
 void disseminateVisitor(IProxyVisitor iVisitor)
          Distributes the visitor object (argument implementing the IProxyVisitor interface) to all nodes of the tree.
 int getChildCount()
          Get the number of child ProxyNode objects owned by this node.
 ClosedInterval getInterval()
          Return the interval occupied by the hardware represented by this proxy node object.
 void leafVisitor(IProxyVisitor iVisitor)
          Distributes the visitor object (argument implementing the IProxyVisitor interface) to all leaves of the proxy tree, whence processVistor() is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyNode

public ProxyNode()
Method Detail

getInterval

public final ClosedInterval getInterval()
Return the interval occupied by the hardware represented by this proxy node object.

Returns:
interval over which this proxy node is defined.

getChildCount

public int getChildCount()
Get the number of child ProxyNode objects owned by this node.

Returns:
number of children of this node

childIterator

public java.util.Iterator childIterator()
Get an iterator object which iterates through all the direct children of this node.

Returns:
Iterator object for direct child nodes

disseminateVisitor

public void disseminateVisitor(IProxyVisitor iVisitor)
                        throws GenerationException
Distributes the visitor object (argument implementing the IProxyVisitor interface) to all nodes of the tree. The processVisitor() method is called on on the current node first, then consecutively on each child node.

Parameters:
iVisitor - visitor object implementing IProxyVisitor
GenerationException
See Also:
gov.sns.xal.model.gen.ptree.ProxyNode#processVisitor(gov.sns.xal.model.gen.ptree.IProxyVisitor)

leafVisitor

public void leafVisitor(IProxyVisitor iVisitor)
                 throws GenerationException
Distributes the visitor object (argument implementing the IProxyVisitor interface) to all leaves of the proxy tree, whence processVistor() is called. This action is implemented by distributing the vistor to all the child nodes of this node. If there are no children then we call the processVisitor() method on this node, which must be a leaf.

Parameters:
iVisitor - visitor object implementing IProxyVisitor
GenerationException
See Also:
gov.sns.xal.model.gen.ptree.ProxyNode#processVisitor(gov.sns.xal.model.gen.ptree.IProxyVisitor)