public interface DataModel
Provides methods for: adding, removing, retrieving, and changing values in a dictionary. Setting a new value for a key already in use, will overwrite the current value using the new value. This happens regardless of the type of value (e.g. storing the value true under the key myBool and afterwards storing an Angle object under the same key will overwrite the value true with the provided Angle object). It can be checked if a key is set. Provides a method for getting a set of all keys
A URCap installation screen has an underlying DataModel object. That object is saved and loaded along with each PolyScope installation.
Similarly, each contributed program node instance has an underlying DataModel object. That object is saved and loaded along with the program where the node occurs. Undo/redo actions are supported for all modifications to the DataModel object.
When retrieving an object both key and object type must match what was stored.
This means that if an Angle object was stored using key myAngle, and an attempt
at retrieving it using get(String key, Angle defaultValue)
with key myAngle,
the stored value will not be retrieved since the types do not match.
Instead the defaultValue provided will be returned.
Modifier and Type | Method and Description |
---|---|
Acceleration |
get(String key,
Acceleration defaultValue)
Get the Acceleration value assigned to the specified key.
|
Angle |
get(String key,
Angle defaultValue)
Get the Angle value assigned to the specified key.
|
AngularAcceleration |
get(String key,
AngularAcceleration defaultValue)
Get the AngularAcceleration value assigned to the specified key.
|
AngularSpeed |
get(String key,
AngularSpeed defaultValue)
Get the AngularSpeed value assigned to the specified key.
|
boolean |
get(String key,
boolean defaultValue)
Get the boolean value assigned to the specified key.
|
boolean[] |
get(String key,
boolean[] defaultValue)
Get the boolean[] as value assigned to the specified key.
|
Current |
get(String key,
Current defaultValue)
Get the Current value assigned to the specified key.
|
double |
get(String key,
double defaultValue)
Get the double value assigned to the specified key.
|
double[] |
get(String key,
double[] defaultValue)
Get the double[] as value assigned to the specified key.
|
float |
get(String key,
float defaultValue)
Get the float value assigned to the specified key.
|
float[] |
get(String key,
float[] defaultValue)
Get the float[] as value assigned to the specified key.
|
Force |
get(String key,
Force defaultValue)
Get the Force value assigned to the specified key.
|
int |
get(String key,
int defaultValue)
Get the int value assigned to the specified key.
|
int[] |
get(String key,
int[] defaultValue)
Get the int[] as value assigned to the specified key.
|
JointPositions |
get(String key,
JointPositions defaultValue)
Get the JointPositions value assigned to the specified key.
|
Length |
get(String key,
Length defaultValue)
Get the Length value assigned to the specified key.
|
long |
get(String key,
long defaultValue)
Get the long value assigned to the specified key.
|
long[] |
get(String key,
long[] defaultValue)
Get the long[] as value assigned to the specified key.
|
Pose |
get(String key,
Pose defaultValue)
Get the Pose value assigned to the specified key.
|
Position |
get(String key,
Position defaultValue)
Get the Position value assigned to the specified key.
|
Rotation |
get(String key,
Rotation defaultValue)
Get the Rotation value assigned to the specified key.
|
Speed |
get(String key,
Speed defaultValue)
Get the Speed value assigned to the specified key.
|
String |
get(String key,
String defaultValue)
Get the String value assigned to the specified key.
|
String[] |
get(String key,
String[] defaultValue)
Get the String[] as value assigned to the specified key.
|
Time |
get(String key,
Time defaultValue)
Get the Time value assigned to the specified key.
|
Torque |
get(String key,
Torque defaultValue)
Get the Torque value assigned to the specified key.
|
Variable |
get(String key,
Variable defaultValue)
Get the Variable value assigned to the specified key.
|
Voltage |
get(String key,
Voltage defaultValue)
Get the Voltage value assigned to the specified key.
|
Set<String> |
getKeys()
Get a Set of all the keys in the data model.
|
boolean |
isSet(String key)
checked if a key is set in the data model.
|
boolean |
remove(String key)
Remove a key-value pair from the data model.
|
void |
set(String key,
Acceleration value)
Assign an Acceleration value to the specified key.
|
void |
set(String key,
Angle value)
Assign an Angle value to the specified key.
|
void |
set(String key,
AngularAcceleration value)
Assign an AngularAcceleration value to the specified key.
|
void |
set(String key,
AngularSpeed value)
Assign an AngularSpeed value to the specified key.
|
void |
set(String key,
boolean value)
Assign a boolean value to the specified key.
|
void |
set(String key,
boolean[] value)
Assign a boolean[] as value to the specified key.
|
void |
set(String key,
Current value)
Assign a Current value to the specified key.
|
void |
set(String key,
double value)
Assign a double value to the specified key.
|
void |
set(String key,
double[] value)
Assign a double[] as value to the specified key.
|
void |
set(String key,
float value)
Assign a float value to the specified key.
|
void |
set(String key,
float[] value)
Assign a float[] as value to the specified key.
|
void |
set(String key,
Force value)
Assign a Force value to the specified key.
|
void |
set(String key,
int value)
Assign an int value to the specified key.
|
void |
set(String key,
int[] value)
Assign a int[] as value to the specified key.
|
void |
set(String key,
JointPositions value)
Assign a JointPositions value to the specified key.
|
void |
set(String key,
Length value)
Assign a Length value to the specified key.
|
void |
set(String key,
long value)
Assign a long value to the specified key.
|
void |
set(String key,
long[] value)
Assign a long[] as value to the specified key.
|
void |
set(String key,
Pose value)
Assign a Pose value to the specified key.
|
void |
set(String key,
Position value)
Assign a Position value to the specified key.
|
void |
set(String key,
Rotation value)
Assign a Rotation value to the specified key.
|
void |
set(String key,
Speed value)
Assign a Speed value to the specified key.
|
void |
set(String key,
String value)
Assign a String value to the specified key.
|
void |
set(String key,
String[] value)
Assign a String[] as value to the specified key.
|
void |
set(String key,
Time value)
Assign a Time value to the specified key.
|
void |
set(String key,
Torque value)
Assign a Torque value to the specified key.
|
void |
set(String key,
Variable value)
Assign a Variable value to the specified key.
|
void |
set(String key,
Voltage value)
Assign a Voltage value to the specified key.
|
void set(String key, boolean value)
Assign a boolean value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
boolean get(String key, boolean defaultValue)
Get the boolean value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, int value)
Assign an int value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
int get(String key, int defaultValue)
Get the int value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, long value)
Assign a long value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
long get(String key, long defaultValue)
Get the long value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, float value)
Assign a float value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
float get(String key, float defaultValue)
Get the float value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, double value)
Assign a double value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
double get(String key, double defaultValue)
Get the double value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, String value)
Assign a String value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
String get(String key, String defaultValue)
Get the String value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, JointPositions value)
Assign a JointPositions value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
JointPositions get(String key, JointPositions defaultValue)
Get the JointPositions value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Variable value)
Assign a Variable value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Variable get(String key, Variable defaultValue)
Get the Variable value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Acceleration value)
Assign an Acceleration value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Acceleration get(String key, Acceleration defaultValue)
Get the Acceleration value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Angle value)
Assign an Angle value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Angle get(String key, Angle defaultValue)
Get the Angle value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, AngularAcceleration value)
Assign an AngularAcceleration value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
AngularAcceleration get(String key, AngularAcceleration defaultValue)
Get the AngularAcceleration value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, AngularSpeed value)
Assign an AngularSpeed value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
AngularSpeed get(String key, AngularSpeed defaultValue)
Get the AngularSpeed value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Current value)
Assign a Current value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Current get(String key, Current defaultValue)
Get the Current value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Force value)
Assign a Force value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Force get(String key, Force defaultValue)
Get the Force value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Length value)
Assign a Length value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Length get(String key, Length defaultValue)
Get the Length value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Pose value)
Assign a Pose value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Pose get(String key, Pose defaultValue)
Get the Pose value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Position value)
Assign a Position value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Position get(String key, Position defaultValue)
Get the Position value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Rotation value)
Assign a Rotation value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Rotation get(String key, Rotation defaultValue)
Get the Rotation value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Speed value)
Assign a Speed value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Speed get(String key, Speed defaultValue)
Get the Speed value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Time value)
Assign a Time value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Time get(String key, Time defaultValue)
Get the Time value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Torque value)
Assign a Torque value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Torque get(String key, Torque defaultValue)
Get the Torque value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, Voltage value)
Assign a Voltage value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
Voltage get(String key, Voltage defaultValue)
Get the Voltage value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, boolean[] value)
Assign a boolean[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
boolean[] get(String key, boolean[] defaultValue)
Get the boolean[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, int[] value)
Assign a int[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
int[] get(String key, int[] defaultValue)
Get the int[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, long[] value)
Assign a long[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
long[] get(String key, long[] defaultValue)
Get the long[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, float[] value)
Assign a float[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
float[] get(String key, float[] defaultValue)
Get the float[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, double[] value)
Assign a double[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
double[] get(String key, double[] defaultValue)
Get the double[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.void set(String key, String[] value)
Assign a String[] as value to the specified key.
key
- key in the data model (not null
and not empty
).value
- value assigned to keyIllegalArgumentException
- if the key is null
or empty
String[] get(String key, String[] defaultValue)
Get the String[] as value assigned to the specified key.
key
- key in the data modeldefaultValue
- value to be returned, if key does not exist.boolean isSet(String key)
checked if a key is set in the data model.
key
- key in the data model.boolean remove(String key)
Remove a key-value pair from the data model.
key
- key in the data model.Copyright © 2018. All rights reserved.