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 DataAdaptor
public boolean hasAttribute(java.lang.String attribute)
hasAttribute
in interface DataAdaptor
public java.lang.String stringValue(java.lang.String attribute)
stringValue
in interface DataAdaptor
public double doubleValue(java.lang.String attribute)
doubleValue
in interface DataAdaptor
public long longValue(java.lang.String attribute)
longValue
in interface DataAdaptor
public int intValue(java.lang.String attribute)
intValue
in interface DataAdaptor
public boolean booleanValue(java.lang.String attribute)
booleanValue
in interface DataAdaptor
public double[] doubleArray(java.lang.String attribute)
DataAdaptor
doubleArray
in interface DataAdaptor
attribute
- 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 DataAdaptor
public void setValue(java.lang.String attribute, double value)
setValue
in interface DataAdaptor
public void setValue(java.lang.String attribute, long value)
setValue
in interface DataAdaptor
public void setValue(java.lang.String attribute, int value)
setValue
in interface DataAdaptor
public void setValue(java.lang.String attribute, boolean value)
setValue
in interface DataAdaptor
public void setValue(java.lang.String attribute, java.lang.Object value)
setValue
in interface DataAdaptor
public void setValue(java.lang.String attribute, double[] value)
double[]
object in the data adaptor backing store.setValue
in interface DataAdaptor
attribute
- attribute namevalue
- attribute valuepublic java.lang.String[] attributes()
attributes
in interface DataAdaptor
public int nodeCount()
public java.util.List<DataAdaptor> childAdaptors()
childAdaptors
in interface DataAdaptor
public java.util.List<DataAdaptor> childAdaptors(java.lang.String label)
childAdaptors
in interface DataAdaptor
public 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 DataAdaptor
public DataAdaptor createChild(java.lang.String label)
createChild
in interface DataAdaptor
public void writeNode(DataListener listener)
writeNode
in interface DataAdaptor
public void writeNodes(java.util.Collection<? extends DataListener> nodes)
writeNodes
in interface DataAdaptor
nodes
- the nodes to write