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 attributesboolean
booleanValue
(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.double
doubleValue
(String attribute) double value associated with the specified attributeboolean
hasAttribute
(String attribute) returns true if the node has the specified attributeint
integer value associated with the specified attributelong
long value associated with the specified attributename()
name for the particular node in the data treeint
return the number of child node adaptorsvoid
removeChild
(DataAdaptor adaptor) Remove a child adaptorvoid
set the value of the specified attribute to the specified valuevoid
set the value of the specified attribute to the specified valuevoid
Stores the value of the givendouble[]
object in the data adaptor backing store.void
set the value of the specified attribute to the specified valuevoid
set the value of the specified attribute to the specified valuevoid
set the value of the specified attribute to the specified valuevoid
set the value of the specified attribute to the specified valuestringValue
(String attribute) string value associated with the specified attributevoid
writeNode
(DataListener listener) write the listener as a new node and append it to the data treevoid
writeNodes
(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:
name
in interfaceDataAdaptor
-
hasAttribute
returns true if the node has the specified attribute- Specified by:
hasAttribute
in interfaceDataAdaptor
-
stringValue
string value associated with the specified attribute- Specified by:
stringValue
in interfaceDataAdaptor
-
doubleValue
double value associated with the specified attribute- Specified by:
doubleValue
in interfaceDataAdaptor
-
longValue
long value associated with the specified attribute- Specified by:
longValue
in interfaceDataAdaptor
-
intValue
integer value associated with the specified attribute- Specified by:
intValue
in interfaceDataAdaptor
-
booleanValue
boolean value associated with the specified attribute- Specified by:
booleanValue
in interfaceDataAdaptor
-
doubleArray
Description copied from interface:DataAdaptor
Returns the value of an attribute as an array of doubles.- Specified by:
doubleArray
in interfaceDataAdaptor
- Parameters:
attribute
- the attribute name- Returns:
- Array of double values, a
null
value is returned if the value string is empty.
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
set the value of the specified attribute to the specified value- Specified by:
setValue
in interfaceDataAdaptor
-
setValue
Stores the value of the givendouble[]
object in the data adaptor backing store.- Specified by:
setValue
in interfaceDataAdaptor
- Parameters:
attribute
- attribute namevalue
- attribute value
-
attributes
return the array of all attributes- Specified by:
attributes
in interfaceDataAdaptor
-
nodeCount
public int nodeCount()return the number of child node adaptors -
childAdaptors
return all child adaptors- Specified by:
childAdaptors
in interfaceDataAdaptor
-
childAdaptors
return all child adaptors of the specified node name- Specified by:
childAdaptors
in 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:
childAdaptor
in interfaceDataAdaptor
-
createChild
Create an new empty child adaptor with label- Specified by:
createChild
in interfaceDataAdaptor
-
removeChild
Description copied from interface:DataAdaptor
Remove a child adaptor- Specified by:
removeChild
in interfaceDataAdaptor
-
writeNode
write the listener as a new node and append it to the data tree- Specified by:
writeNode
in interfaceDataAdaptor
-
writeNodes
Write the collection of listeners to new nodes and append them to the data tree.- Specified by:
writeNodes
in interfaceDataAdaptor
- Parameters:
nodes
- the nodes to write
-