Path

public class Path implements Comparable<Path>

A zenoh Path is a set of strings separated by ‘/’ , as in a filesystem path. A Path cannot contain any ‘*’ character. Examples of paths: “/zenoh/examples/test” , “/com/adlink/building/fr/floor/1/office/2” …

A path can be absolute (i.e. starting with a ‘/’) or relative to a Workspace.

See also: Workspace.put(Path,Value)

Constructors

Path

public Path(String p)

Create a Path from a string such as “/zenoh/examples/test”.

Parameters:
  • p – the string

Methods

addPrefix

public Path addPrefix(Path prefix)

Returns a new Path made of the concatenation of the specified prefix and this Path.

Parameters:
  • prefix – the prefix to add.
Returns:

a new Path made of the prefix plus this Path.

compareTo

public int compareTo(Path p)

equals

public boolean equals(Object object)

hashCode

public int hashCode()

isRelative

static boolean isRelative(String p)

isRelative

public boolean isRelative()

Returns true if the Path is relative (i.e. it doesn’t start with ‘/’)

Returns:true if the Path is relative.

length

public int length()

The Path length (i.e. the length of the Path as a string)

Returns:the length

toString

public String toString()