org.ros.node.parameter
Interface ParameterTree

All Known Implementing Classes:
AnonymousParmeterTree, DefaultParameterTree

public interface ParameterTree

Provides access to a ParameterServer.

A parameter server is a shared, multi-variate dictionary that is accessible via network APIs. Nodes use this server to store and retrieve parameters at runtime. As it is not designed for high-performance, it is best used for static, non-binary data such as configuration parameters. It is meant to be globally viewable so that tools can easily inspect the configuration state of the system and modify if necessary.

See Also:
Parameter server documentation

Method Summary
 void addParameterListener(GraphName name, ParameterListener listener)
          Subscribes to changes to the specified parameter.
 void addParameterListener(java.lang.String name, ParameterListener listener)
           
 void delete(GraphName name)
          Deletes a specified parameter.
 void delete(java.lang.String name)
           
 boolean getBoolean(GraphName name)
           
 boolean getBoolean(GraphName name, boolean defaultValue)
           
 boolean getBoolean(java.lang.String name)
           
 boolean getBoolean(java.lang.String name, boolean defaultValue)
           
 double getDouble(GraphName name)
           
 double getDouble(GraphName name, double defaultValue)
           
 double getDouble(java.lang.String name)
           
 double getDouble(java.lang.String name, double defaultValue)
           
 int getInteger(GraphName name)
           
 int getInteger(GraphName name, int defaultValue)
           
 int getInteger(java.lang.String name)
           
 int getInteger(java.lang.String name, int defaultValue)
           
 java.util.List<?> getList(GraphName name)
           
 java.util.List<?> getList(GraphName name, java.util.List<?> defaultValue)
           
 java.util.List<?> getList(java.lang.String name)
           
 java.util.List<?> getList(java.lang.String name, java.util.List<?> defaultValue)
           
 java.util.Map<?,?> getMap(GraphName name)
           
 java.util.Map<?,?> getMap(GraphName name, java.util.Map<?,?> defaultValue)
           
 java.util.Map<?,?> getMap(java.lang.String name)
           
 java.util.Map<?,?> getMap(java.lang.String name, java.util.Map<?,?> defaultValue)
           
 java.util.Collection<GraphName> getNames()
           
 java.lang.String getString(GraphName name)
           
 java.lang.String getString(GraphName name, java.lang.String defaultValue)
           
 java.lang.String getString(java.lang.String name)
           
 java.lang.String getString(java.lang.String name, java.lang.String defaultValue)
           
 boolean has(GraphName name)
           
 boolean has(java.lang.String name)
           
 void removeParameterListener(GraphName name, ParameterListener listener)
          Unsubscribes from changes to the specified parameter.
 void removeParameterListener(java.lang.String name, ParameterListener listener)
           
 GraphName search(GraphName name)
          Search for parameter key on the Parameter Server.
 GraphName search(java.lang.String name)
           
 void set(GraphName name, boolean value)
           
 void set(GraphName name, double value)
           
 void set(GraphName name, int value)
           
 void set(GraphName name, java.util.List<?> value)
           
 void set(GraphName name, java.util.Map<?,?> value)
           
 void set(GraphName name, java.lang.String value)
           
 void set(java.lang.String name, boolean value)
           
 void set(java.lang.String name, double value)
           
 void set(java.lang.String name, int value)
           
 void set(java.lang.String name, java.util.List<?> value)
           
 void set(java.lang.String name, java.util.Map<?,?> value)
           
 void set(java.lang.String name, java.lang.String value)
           
 

Method Detail

getBoolean

boolean getBoolean(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getBoolean

boolean getBoolean(java.lang.String name)
See Also:
getBoolean(GraphName)

getBoolean

boolean getBoolean(GraphName name,
                   boolean defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getBoolean

boolean getBoolean(java.lang.String name,
                   boolean defaultValue)
See Also:
getBoolean(GraphName, boolean)

getInteger

int getInteger(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getInteger

int getInteger(java.lang.String name)
See Also:
getInteger(GraphName)

getInteger

int getInteger(GraphName name,
               int defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getInteger

int getInteger(java.lang.String name,
               int defaultValue)
See Also:
getInteger(GraphName, int)

getDouble

double getDouble(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getDouble

double getDouble(java.lang.String name)
See Also:
getDouble(GraphName)

getDouble

double getDouble(GraphName name,
                 double defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getDouble

double getDouble(java.lang.String name,
                 double defaultValue)
See Also:
getDouble(GraphName, double)

getString

java.lang.String getString(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value:w
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getString

java.lang.String getString(java.lang.String name)
See Also:
getString(GraphName)

getString

java.lang.String getString(GraphName name,
                           java.lang.String defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getString

java.lang.String getString(java.lang.String name,
                           java.lang.String defaultValue)
See Also:
getString(GraphName, String)

getList

java.util.List<?> getList(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getList

java.util.List<?> getList(java.lang.String name)
See Also:
getList(GraphName)

getList

java.util.List<?> getList(GraphName name,
                          java.util.List<?> defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getList

java.util.List<?> getList(java.lang.String name,
                          java.util.List<?> defaultValue)
See Also:
getList(GraphName, List)

getMap

java.util.Map<?,?> getMap(GraphName name)
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
ParameterNotFoundException - if the parameter is not found
ParameterClassCastException - if the parameter is not the expected type

getMap

java.util.Map<?,?> getMap(java.lang.String name)
See Also:
getMap(GraphName)

getMap

java.util.Map<?,?> getMap(GraphName name,
                          java.util.Map<?,?> defaultValue)
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist
Throws:
ParameterClassCastException - if the parameter exists and is not the expected type

getMap

java.util.Map<?,?> getMap(java.lang.String name,
                          java.util.Map<?,?> defaultValue)
See Also:
getMap(GraphName, Map)

set

void set(GraphName name,
         boolean value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         boolean value)
See Also:
set(GraphName, boolean)

set

void set(GraphName name,
         int value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         int value)
See Also:
set(GraphName, int)

set

void set(GraphName name,
         double value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         double value)
See Also:
set(GraphName, double)

set

void set(GraphName name,
         java.lang.String value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         java.lang.String value)
See Also:
set(GraphName, String)

set

void set(GraphName name,
         java.util.List<?> value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         java.util.List<?> value)
See Also:
set(GraphName, List)

set

void set(GraphName name,
         java.util.Map<?,?> value)
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

void set(java.lang.String name,
         java.util.Map<?,?> value)
See Also:
set(GraphName, Map)

has

boolean has(GraphName name)
Parameters:
name - the parameter name
Returns:
true if a parameter with the given name exists, false otherwise

has

boolean has(java.lang.String name)
See Also:
has(GraphName)

delete

void delete(GraphName name)
Deletes a specified parameter.

Parameters:
name - the parameter name

delete

void delete(java.lang.String name)
See Also:
delete(GraphName)

search

GraphName search(GraphName name)
Search for parameter key on the Parameter Server. Search starts in caller's namespace and proceeds upwards through parent namespaces until the ParameterServer finds a matching key.

Parameters:
name - the parameter name to search for
Returns:
the name of the found parameter or null if no matching parameter was found

search

GraphName search(java.lang.String name)
See Also:
search(GraphName)

getNames

java.util.Collection<GraphName> getNames()
Returns:
all known parameter names

addParameterListener

void addParameterListener(GraphName name,
                          ParameterListener listener)
Subscribes to changes to the specified parameter.

Parameters:
name - the parameter name to subscribe to
listener - a ParameterListener that will be called when the subscribed parameter changes

addParameterListener

void addParameterListener(java.lang.String name,
                          ParameterListener listener)
See Also:
addParameterListener(GraphName, ParameterListener)

removeParameterListener

void removeParameterListener(GraphName name,
                             ParameterListener listener)
Unsubscribes from changes to the specified parameter.

Parameters:
name -
listener -

removeParameterListener

void removeParameterListener(java.lang.String name,
                             ParameterListener listener)
See Also:
removeParameterListener(GraphName, ParameterListener)