gov.sns.xal.smf.proxy
Class PrimaryPropertyAccessor

java.lang.Object
  |
  +--gov.sns.xal.smf.proxy.PrimaryPropertyAccessor

public class PrimaryPropertyAccessor
extends java.lang.Object


Constructor Summary
PrimaryPropertyAccessor()
           
 
Method Summary
protected  void addInput(ModelInput anInput)
           
protected static double doubleValueFor(AcceleratorNode node, java.lang.String property, java.lang.String mode)
          Returns the double value for the specified property of the supplied node, using the specified mode.
 ModelInput getInput(AcceleratorNode aNode, java.lang.String propName)
          Returns the ModelInput for the specified node's property, or null if there is none.
 boolean hasAccessorFor(AcceleratorNode aNode)
          Returns true if there is an accessor for the specified node type, false otherwise.
 java.util.List propertyNamesFor(AcceleratorNode aNode)
          Returns a List of property names for the supplied node.
 void removeInput(AcceleratorNode aNode, java.lang.String property)
           
 ModelInput setModelInput(AcceleratorNode aNode, java.lang.String property, double val)
          Sets the specified node's property to the specified value.
static java.util.Map valueMapFor(java.lang.Object objNode, java.lang.String mode)
          Returns a Map of property values for the supplied node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimaryPropertyAccessor

public PrimaryPropertyAccessor()
Method Detail

doubleValueFor

protected static double doubleValueFor(AcceleratorNode node,
                                       java.lang.String property,
                                       java.lang.String mode)
                                throws ProxyException
Returns the double value for the specified property of the supplied node, using the specified mode.

Parameters:
node - AcceleratorNode to get property value for
property - name of node property to get value for
mode - either PropertyAccessor.SYNC_MODE_LIVE or PropertyAccessor.SYNC_MODE_Design
Returns:
a double value for the specified node property using mode
Throws:
ProxyException - if the node's accessor encounters an error getting a property value

valueMapFor

public static java.util.Map valueMapFor(java.lang.Object objNode,
                                        java.lang.String mode)
                                 throws ProxyException
Returns a Map of property values for the supplied node. The map's keys are the property names as defined by the node class' propertyNames method, values are the Double value for that property on aNode.

Returns:
a Map of node property values
Throws:
ProxyException - if the node's accessor encounters an error getting a property value

propertyNamesFor

public java.util.List propertyNamesFor(AcceleratorNode aNode)
Returns a List of property names for the supplied node.

Parameters:
aNode - AcceleratorNode whose property names to return
Returns:
a List of property names for aNode

hasAccessorFor

public boolean hasAccessorFor(AcceleratorNode aNode)
Returns true if there is an accessor for the specified node type, false otherwise.

Parameters:
aNode - AcceleratorNode whose type to find an accessor for
Returns:
true if there is an accessor for the supplied node, false otherwise

setModelInput

public ModelInput setModelInput(AcceleratorNode aNode,
                                java.lang.String property,
                                double val)
Sets the specified node's property to the specified value. Replaces the existing value if there is one.

Parameters:
aNode - node whose property to set
property - name of property to set
val - double value for property

getInput

public ModelInput getInput(AcceleratorNode aNode,
                           java.lang.String propName)
Returns the ModelInput for the specified node's property, or null if there is none.

Parameters:
aNode - node whose property to get a ModelInput for
propName - name of property to get a ModelInput for

addInput

protected void addInput(ModelInput anInput)

removeInput

public void removeInput(AcceleratorNode aNode,
                        java.lang.String property)