public class InMemoryDataAdaptor extends java.lang.Object implements DataAdaptor
| Constructor and Description |
|---|
InMemoryDataAdaptor(java.lang.String name)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
attributes()
return the array of all attributes
|
boolean |
booleanValue(java.lang.String attribute)
boolean value associated with the specified attribute
|
DataAdaptor |
childAdaptor(java.lang.String label)
Convenience method to get a single child adaptor when only one is expected
|
java.util.Iterator<DataAdaptor> |
childAdaptorIterator()
return an iterator of all child adaptors
|
java.util.Iterator<DataAdaptor> |
childAdaptorIterator(java.lang.String label)
return an iterator of all child adaptors of the specified name
|
java.util.List<DataAdaptor> |
childAdaptors()
return all child adaptors
|
java.util.List<DataAdaptor> |
childAdaptors(java.lang.String label)
return all child adaptors of the specified node name
|
DataAdaptor |
createChild(java.lang.String label)
Create an new empty child adaptor with label
|
double[] |
doubleArray(java.lang.String attribute)
Returns the value of an attribute as an array of doubles.
|
double |
doubleValue(java.lang.String attribute)
double value associated with the specified attribute
|
boolean |
hasAttribute(java.lang.String attribute)
returns true iff the node has the specified attribute
|
int |
intValue(java.lang.String attribute)
integer value associated with the specified attribute
|
long |
longValue(java.lang.String attribute)
long value associated with the specified attribute
|
java.lang.String |
name()
name for the particular node in the data tree
|
int |
nodeCount()
return the number of child node adaptors
|
void |
setValue(java.lang.String attribute,
boolean value)
set the value of the specified attribute to the specified value
|
void |
setValue(java.lang.String attribute,
double value)
set the value of the specified attribute to the specified value
|
void |
setValue(java.lang.String attribute,
double[] value)
Stores the value of the given
double[] object in the data adaptor backing store. |
void |
setValue(java.lang.String attribute,
int value)
set the value of the specified attribute to the specified value
|
void |
setValue(java.lang.String attribute,
long value)
set the value of the specified attribute to the specified value
|
void |
setValue(java.lang.String attribute,
java.lang.Object value)
set the value of the specified attribute to the specified value
|
void |
setValue(java.lang.String attribute,
java.lang.String value)
set the value of the specified attribute to the specified value
|
java.lang.String |
stringValue(java.lang.String attribute)
string value associated with the specified attribute
|
void |
writeNode(DataListener listener)
write the listener as a new node and append it to the data tree
|
void |
writeNodes(java.util.Collection<? extends DataListener> nodes)
Write the collection of listeners to new nodes and append them to the data tree.
|
public InMemoryDataAdaptor(java.lang.String name)
public java.lang.String name()
name in interface DataAdaptorpublic boolean hasAttribute(java.lang.String attribute)
hasAttribute in interface DataAdaptorpublic java.lang.String stringValue(java.lang.String attribute)
stringValue in interface DataAdaptorpublic double doubleValue(java.lang.String attribute)
doubleValue in interface DataAdaptorpublic long longValue(java.lang.String attribute)
longValue in interface DataAdaptorpublic int intValue(java.lang.String attribute)
intValue in interface DataAdaptorpublic boolean booleanValue(java.lang.String attribute)
booleanValue in interface DataAdaptorpublic double[] doubleArray(java.lang.String attribute)
DataAdaptordoubleArray in interface DataAdaptorattribute - the attribute namenull value is returned if the value string is empty.public void setValue(java.lang.String attribute,
java.lang.String value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
double value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
long value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
int value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
boolean value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
java.lang.Object value)
setValue in interface DataAdaptorpublic void setValue(java.lang.String attribute,
double[] value)
double[] object in the data adaptor backing store.setValue in interface DataAdaptorattribute - attribute namevalue - attribute valuepublic java.lang.String[] attributes()
attributes in interface DataAdaptorpublic int nodeCount()
public java.util.List<DataAdaptor> childAdaptors()
childAdaptors in interface DataAdaptorpublic java.util.List<DataAdaptor> childAdaptors(java.lang.String label)
childAdaptors in interface DataAdaptorpublic java.util.Iterator<DataAdaptor> childAdaptorIterator()
public java.util.Iterator<DataAdaptor> childAdaptorIterator(java.lang.String label)
public DataAdaptor childAdaptor(java.lang.String label)
childAdaptor in interface DataAdaptorpublic DataAdaptor createChild(java.lang.String label)
createChild in interface DataAdaptorpublic void writeNode(DataListener listener)
writeNode in interface DataAdaptorpublic void writeNodes(java.util.Collection<? extends DataListener> nodes)
writeNodes in interface DataAdaptornodes - the nodes to write