Package org.ros.namespace
Class GraphName
java.lang.Object
org.ros.namespace.GraphName
ROS graph resource name.
- Author:
- damonkohler@google.com (Damon Kohler)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphNameempty()booleaninthashCode()booleanisEmpty()booleanisGlobal()Is this a /global/name? If node node1 in the global / namespace accesses the resource /bar, that will resolve to the name /bar. If node node2 in the /wg/ namespace accesses the resource /foo, that will resolve to the name /foo. If node node3 in the /wg/ namespace accesses the resource /foo/bar, that will resolve to the name /foo/bar.booleanIs this a ~private/name? If node node1 in the global / namespace accesses the resource ~bar, that will resolve to the name /node1/bar.booleanIs this a relative/name? If node node1 in the global / namespace accesses the resource ~bar, that will resolve to the name /node1/bar.booleanisRoot()Join thisGraphNamewith another.static GraphNameCreates an anonymousGraphName.static GraphNameReturns a newGraphNameof the specifiedname.static GraphNameroot()toGlobal()Convert name to a global name representation.Convert name to a relative name representation.toString()
-
Method Details
-
newAnonymous
Creates an anonymousGraphName.- Returns:
- a new
GraphNamesuitable for creating an anonymous node
-
root
- Returns:
- a
GraphNamerepresenting the root namespace
-
empty
- Returns:
- an empty
GraphName
-
of
Returns a newGraphNameof the specifiedname.- Parameters:
name- the name of this resource- Returns:
- a new
GraphNameforname
-
isGlobal
public boolean isGlobal()Is this a /global/name?- If node node1 in the global / namespace accesses the resource /bar, that will resolve to the name /bar.
- If node node2 in the /wg/ namespace accesses the resource /foo, that will resolve to the name /foo.
- If node node3 in the /wg/ namespace accesses the resource /foo/bar, that will resolve to the name /foo/bar.
- Returns:
trueif this name is a global name,falseotherwise
-
isRoot
public boolean isRoot()- Returns:
trueif thisGraphNamerepresents the root namespace,falseotherwise
-
isEmpty
public boolean isEmpty()- Returns:
trueif thisGraphNameis empty,falseotherwise
-
isPrivate
public boolean isPrivate()Is this a ~private/name?- If node node1 in the global / namespace accesses the resource ~bar, that will resolve to the name /node1/bar.
- If node node2 in the /wg/ namespace accesses the resource ~foo, that will resolve to the name /wg/node2/foo.
- If node node3 in the /wg/ namespace accesses the resource ~foo/bar, that will resolve to the name /wg/node3/foo/bar.
- Returns:
trueif the name is a private name,falseotherwise
-
isRelative
public boolean isRelative()Is this a relative/name?- If node node1 in the global / namespace accesses the resource ~bar, that will resolve to the name /node1/bar.
- If node node2 in the /wg/ namespace accesses the resource ~foo, that will resolve to the name /wg/node2/foo.
- If node node3 in the /wg/ namespace accesses the resource ~foo/bar, that will resolve to the name /wg/node3/foo/bar.
- Returns:
- true if the name is a relative name.
-
getParent
-
getBasename
- Returns:
- a
GraphNamewithout the leading parent namespace
-
toRelative
Convert name to a relative name representation. This does not take any namespace into account; it simply strips any preceding characters for global or private name representation.- Returns:
- a relative
GraphName
-
toGlobal
Convert name to a global name representation. This does not take any namespace into account; it simply adds in the global prefix "/" if missing.- Returns:
- a global
GraphName
-
join
Join thisGraphNamewith another. -
join
- See Also:
-
toString
-
hashCode
public int hashCode() -
equals
-