Package xal.tools.data
Class InMemoryDataAdaptor
java.lang.Object
xal.tools.data.InMemoryDataAdaptor
- All Implemented Interfaces:
DataAdaptor
InMemoryDataAdaptor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]return the array of all attributesbooleanbooleanValue(String attribute) boolean value associated with the specified attributechildAdaptor(String label) Convenience method to get a single child adaptor when only one is expectedreturn an iterator of all child adaptorschildAdaptorIterator(String label) return an iterator of all child adaptors of the specified namereturn all child adaptorschildAdaptors(String label) return all child adaptors of the specified node namecreateChild(String label) Create an new empty child adaptor with labeldouble[]doubleArray(String attribute) Returns the value of an attribute as an array of doubles.doubledoubleValue(String attribute) double value associated with the specified attributebooleanhasAttribute(String attribute) returns true if the node has the specified attributeintinteger value associated with the specified attributelonglong value associated with the specified attributename()name for the particular node in the data treeintreturn the number of child node adaptorsvoidremoveChild(DataAdaptor adaptor) Remove a child adaptorvoidset the value of the specified attribute to the specified valuevoidset the value of the specified attribute to the specified valuevoidStores the value of the givendouble[]object in the data adaptor backing store.voidset the value of the specified attribute to the specified valuevoidset the value of the specified attribute to the specified valuevoidset the value of the specified attribute to the specified valuevoidset the value of the specified attribute to the specified valuestringValue(String attribute) string value associated with the specified attributevoidwriteNode(DataListener listener) write the listener as a new node and append it to the data treevoidwriteNodes(Collection<? extends DataListener> nodes) Write the collection of listeners to new nodes and append them to the data tree.
-
Constructor Details
-
InMemoryDataAdaptor
Constructor
-
-
Method Details
-
name
name for the particular node in the data tree- Specified by:
namein interfaceDataAdaptor
-
hasAttribute
returns true if the node has the specified attribute- Specified by:
hasAttributein interfaceDataAdaptor
-
stringValue
string value associated with the specified attribute- Specified by:
stringValuein interfaceDataAdaptor
-
doubleValue
double value associated with the specified attribute- Specified by:
doubleValuein interfaceDataAdaptor
-
longValue
long value associated with the specified attribute- Specified by:
longValuein interfaceDataAdaptor
-
intValue
integer value associated with the specified attribute- Specified by:
intValuein interfaceDataAdaptor
-
booleanValue
boolean value associated with the specified attribute- Specified by:
booleanValuein interfaceDataAdaptor
-
doubleArray
Description copied from interface:DataAdaptorReturns the value of an attribute as an array of doubles.- Specified by:
doubleArrayin interfaceDataAdaptor- Parameters:
attribute- the attribute name- Returns:
- Array of double values, a
nullvalue is returned if the value string is empty.
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValuein interfaceDataAdaptor
-
setValue
Stores the value of the givendouble[]object in the data adaptor backing store.- Specified by:
setValuein interfaceDataAdaptor- Parameters:
attribute- attribute namevalue- attribute value
-
attributes
return the array of all attributes- Specified by:
attributesin interfaceDataAdaptor
-
nodeCount
public int nodeCount()return the number of child node adaptors -
childAdaptors
return all child adaptors- Specified by:
childAdaptorsin interfaceDataAdaptor
-
childAdaptors
return all child adaptors of the specified node name- Specified by:
childAdaptorsin interfaceDataAdaptor
-
childAdaptorIterator
return an iterator of all child adaptors -
childAdaptorIterator
return an iterator of all child adaptors of the specified name -
childAdaptor
Convenience method to get a single child adaptor when only one is expected- Specified by:
childAdaptorin interfaceDataAdaptor
-
createChild
Create an new empty child adaptor with label- Specified by:
createChildin interfaceDataAdaptor
-
removeChild
Description copied from interface:DataAdaptorRemove a child adaptor- Specified by:
removeChildin interfaceDataAdaptor
-
writeNode
write the listener as a new node and append it to the data tree- Specified by:
writeNodein interfaceDataAdaptor
-
writeNodes
Write the collection of listeners to new nodes and append them to the data tree.- Specified by:
writeNodesin interfaceDataAdaptor- Parameters:
nodes- the nodes to write
-