public class Path
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PATH_SEPARATOR
The path separator.
|
Constructor and Description |
---|
Path()
Constructor for an empty path.
|
Path(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
Path |
addId(java.lang.String id)
Create a new path by adding a new path element identified by they id to
this path.
|
Path |
addPath(Path extra)
Create a new path by adding a path to this path.
|
boolean |
equals(java.lang.Object obj) |
Path |
getChildPath()
Get the path below the topmost element.
|
java.lang.String |
getId() |
Path |
getParent() |
java.lang.String |
getRoot()
Get the id of the top element in the path.
|
int |
hashCode() |
Path |
relativeTo(Path other)
Resolve the other path relative to this path.
|
int |
size()
Return the size or depth of this path.
|
java.lang.String |
toString() |
public static final java.lang.String PATH_SEPARATOR
public Path()
public Path(java.lang.String path)
public int size()
public java.lang.String getRoot()
public java.lang.String getId()
public Path getChildPath()
public Path addId(java.lang.String id)
id
- The id of the new path element. May be null.public Path getParent()
public Path addPath(Path extra)
extra
- The extra path.public Path relativeTo(Path other)
other
- The other path.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object