org.ros.namespace
Class NameResolver

java.lang.Object
  extended by org.ros.namespace.NameResolver
Direct Known Subclasses:
NodeNameResolver

public class NameResolver
extends java.lang.Object


Constructor Summary
NameResolver(GraphName namespace, java.util.Map<GraphName,GraphName> remappings)
           
 
Method Summary
 GraphName getNamespace()
           
 java.util.Map<GraphName,GraphName> getRemappings()
           
protected  GraphName lookUpRemapping(GraphName name)
           
 NameResolver newChild(GraphName namespace)
          Construct a new child NameResolver with the same remappings as this NameResolver.
 NameResolver newChild(java.lang.String namespace)
           
static NameResolver newFromNamespace(GraphName namespace)
           
static NameResolver newFromNamespace(java.lang.String namespace)
           
static NameResolver newFromNamespaceAndRemappings(java.lang.String namespace, java.util.Map<GraphName,GraphName> remappings)
           
static NameResolver newRoot()
           
static NameResolver newRootFromRemappings(java.util.Map<GraphName,GraphName> remappings)
           
 GraphName resolve(GraphName name)
           
 GraphName resolve(GraphName namespace, GraphName name)
          Resolve name relative to namespace.
 GraphName resolve(GraphName namespace, java.lang.String name)
           
 GraphName resolve(java.lang.String name)
           
 GraphName resolve(java.lang.String namespace, GraphName name)
           
 GraphName resolve(java.lang.String namespace, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameResolver

public NameResolver(GraphName namespace,
                    java.util.Map<GraphName,GraphName> remappings)
Method Detail

newFromNamespace

public static NameResolver newFromNamespace(GraphName namespace)

newFromNamespace

public static NameResolver newFromNamespace(java.lang.String namespace)

newRoot

public static NameResolver newRoot()

newRootFromRemappings

public static NameResolver newRootFromRemappings(java.util.Map<GraphName,GraphName> remappings)

newFromNamespaceAndRemappings

public static NameResolver newFromNamespaceAndRemappings(java.lang.String namespace,
                                                         java.util.Map<GraphName,GraphName> remappings)

getNamespace

public GraphName getNamespace()

resolve

public GraphName resolve(GraphName namespace,
                         GraphName name)
Resolve name relative to namespace. If namespace is not global, it will first be resolved to a global name. This method will not resolve private ~names. This does all remappings of both the namespace and name.

Parameters:
namespace -
name -
Returns:
the fully resolved name relative to the given namespace

resolve

public GraphName resolve(java.lang.String namespace,
                         java.lang.String name)
See Also:
resolve(GraphName, GraphName)

resolve

public GraphName resolve(GraphName namespace,
                         java.lang.String name)
See Also:
resolve(GraphName, GraphName)

resolve

public GraphName resolve(java.lang.String namespace,
                         GraphName name)
See Also:
resolve(GraphName, GraphName)

resolve

public GraphName resolve(GraphName name)
Parameters:
name - name to resolve
Returns:
the name resolved relative to the default namespace

resolve

public GraphName resolve(java.lang.String name)
See Also:
resolve(GraphName)

getRemappings

public java.util.Map<GraphName,GraphName> getRemappings()
Returns:
remappings

newChild

public NameResolver newChild(GraphName namespace)
Construct a new child NameResolver with the same remappings as this NameResolver. The namespace of the new child NameResolver will be the resolved in this namespace.

Parameters:
namespace - the namespace of the child NameResolver relative to this NameResolver's namespace
Returns:
a new child NameResolver whose namespace is relative to the parent NameResolver's namespace

newChild

public NameResolver newChild(java.lang.String namespace)
See Also:
newChild(GraphName)

lookUpRemapping

protected GraphName lookUpRemapping(GraphName name)