org.ros.internal.node.parameter
Class DefaultParameterTree

java.lang.Object
  extended by org.ros.internal.node.parameter.DefaultParameterTree
All Implemented Interfaces:
ParameterTree

public class DefaultParameterTree
extends java.lang.Object
implements ParameterTree

Provides access to the ROS ParameterServer.


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.List<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)
           
static DefaultParameterTree newFromNodeIdentifier(NodeIdentifier nodeIdentifier, java.net.URI masterUri, NameResolver resolver, ParameterManager parameterManager)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newFromNodeIdentifier

public static DefaultParameterTree newFromNodeIdentifier(NodeIdentifier nodeIdentifier,
                                                         java.net.URI masterUri,
                                                         NameResolver resolver,
                                                         ParameterManager parameterManager)

has

public boolean has(GraphName name)
Specified by:
has in interface ParameterTree
Parameters:
name - the parameter name
Returns:
true if a parameter with the given name exists, false otherwise

has

public boolean has(java.lang.String name)
Specified by:
has in interface ParameterTree
See Also:
ParameterTree.has(GraphName)

delete

public void delete(GraphName name)
Description copied from interface: ParameterTree
Deletes a specified parameter.

Specified by:
delete in interface ParameterTree
Parameters:
name - the parameter name

delete

public void delete(java.lang.String name)
Specified by:
delete in interface ParameterTree
See Also:
ParameterTree.delete(GraphName)

search

public GraphName search(GraphName name)
Description copied from interface: ParameterTree
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.

Specified by:
search in interface ParameterTree
Parameters:
name - the parameter name to search for
Returns:
the name of the found parameter or null if no matching parameter was found

search

public GraphName search(java.lang.String name)
Specified by:
search in interface ParameterTree
See Also:
ParameterTree.search(GraphName)

getNames

public java.util.List<GraphName> getNames()
Specified by:
getNames in interface ParameterTree
Returns:
all known parameter names

addParameterListener

public void addParameterListener(GraphName name,
                                 ParameterListener listener)
Description copied from interface: ParameterTree
Subscribes to changes to the specified parameter.

Specified by:
addParameterListener in interface ParameterTree
Parameters:
name - the parameter name to subscribe to
listener - a ParameterListener that will be called when the subscribed parameter changes

addParameterListener

public void addParameterListener(java.lang.String name,
                                 ParameterListener listener)
Specified by:
addParameterListener in interface ParameterTree
See Also:
ParameterTree.addParameterListener(GraphName, ParameterListener)

removeParameterListener

public void removeParameterListener(GraphName name,
                                    ParameterListener listener)
Description copied from interface: ParameterTree
Unsubscribes from changes to the specified parameter.

Specified by:
removeParameterListener in interface ParameterTree

removeParameterListener

public void removeParameterListener(java.lang.String name,
                                    ParameterListener listener)
Specified by:
removeParameterListener in interface ParameterTree
See Also:
ParameterTree.removeParameterListener(GraphName, ParameterListener)

set

public void set(GraphName name,
                boolean value)
Specified by:
set in interface ParameterTree
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

public void set(java.lang.String name,
                boolean value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, boolean)

set

public void set(GraphName name,
                int value)
Specified by:
set in interface ParameterTree
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

public void set(java.lang.String name,
                int value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, int)

set

public void set(GraphName name,
                double value)
Specified by:
set in interface ParameterTree
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

public void set(java.lang.String name,
                double value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, double)

set

public void set(GraphName name,
                java.lang.String value)
Specified by:
set in interface ParameterTree
Parameters:
name - the parameter name
value - the value that the parameter will be set to

set

public void set(java.lang.String name,
                java.lang.String value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, String)

set

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

set

public void set(java.lang.String name,
                java.util.List<?> value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, List)

set

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

set

public void set(java.lang.String name,
                java.util.Map<?,?> value)
Specified by:
set in interface ParameterTree
See Also:
ParameterTree.set(GraphName, Map)

getBoolean

public boolean getBoolean(GraphName name)
Specified by:
getBoolean in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value

getBoolean

public boolean getBoolean(java.lang.String name)
Specified by:
getBoolean in interface ParameterTree
See Also:
ParameterTree.getBoolean(GraphName)

getBoolean

public boolean getBoolean(GraphName name,
                          boolean defaultValue)
Specified by:
getBoolean in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getBoolean

public boolean getBoolean(java.lang.String name,
                          boolean defaultValue)
Specified by:
getBoolean in interface ParameterTree
See Also:
ParameterTree.getBoolean(GraphName, boolean)

getInteger

public int getInteger(GraphName name)
Specified by:
getInteger in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value

getInteger

public int getInteger(java.lang.String name)
Specified by:
getInteger in interface ParameterTree
See Also:
ParameterTree.getInteger(GraphName)

getInteger

public int getInteger(GraphName name,
                      int defaultValue)
Specified by:
getInteger in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getInteger

public int getInteger(java.lang.String name,
                      int defaultValue)
Specified by:
getInteger in interface ParameterTree
See Also:
ParameterTree.getInteger(GraphName, int)

getDouble

public double getDouble(GraphName name)
Specified by:
getDouble in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value

getDouble

public double getDouble(java.lang.String name)
Specified by:
getDouble in interface ParameterTree
See Also:
ParameterTree.getDouble(GraphName)

getDouble

public double getDouble(GraphName name,
                        double defaultValue)
Specified by:
getDouble in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getDouble

public double getDouble(java.lang.String name,
                        double defaultValue)
Specified by:
getDouble in interface ParameterTree
See Also:
ParameterTree.getDouble(GraphName, double)

getString

public java.lang.String getString(GraphName name)
Specified by:
getString in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value:w

getString

public java.lang.String getString(java.lang.String name)
Specified by:
getString in interface ParameterTree
See Also:
ParameterTree.getString(GraphName)

getString

public java.lang.String getString(GraphName name,
                                  java.lang.String defaultValue)
Specified by:
getString in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getString

public java.lang.String getString(java.lang.String name,
                                  java.lang.String defaultValue)
Specified by:
getString in interface ParameterTree
See Also:
ParameterTree.getString(GraphName, String)

getList

public java.util.List<?> getList(GraphName name)
Specified by:
getList in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value

getList

public java.util.List<?> getList(java.lang.String name)
Specified by:
getList in interface ParameterTree
See Also:
ParameterTree.getList(GraphName)

getList

public java.util.List<?> getList(GraphName name,
                                 java.util.List<?> defaultValue)
Specified by:
getList in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getList

public java.util.List<?> getList(java.lang.String name,
                                 java.util.List<?> defaultValue)
Specified by:
getList in interface ParameterTree
See Also:
ParameterTree.getList(GraphName, List)

getMap

public java.util.Map<?,?> getMap(GraphName name)
Specified by:
getMap in interface ParameterTree
Parameters:
name - the parameter name
Returns:
the parameter value

getMap

public java.util.Map<?,?> getMap(java.lang.String name)
Specified by:
getMap in interface ParameterTree
See Also:
ParameterTree.getMap(GraphName)

getMap

public java.util.Map<?,?> getMap(GraphName name,
                                 java.util.Map<?,?> defaultValue)
Specified by:
getMap in interface ParameterTree
Parameters:
name - the parameter name
defaultValue - the default value
Returns:
the parameter value or the default value if the parameter does not exist

getMap

public java.util.Map<?,?> getMap(java.lang.String name,
                                 java.util.Map<?,?> defaultValue)
Specified by:
getMap in interface ParameterTree
See Also:
ParameterTree.getMap(GraphName, Map)