Comparable<Path>
public class Path extends Object implements Comparable<Path>
Modifier and Type | Method | Description |
---|---|---|
String |
absolutePath(String path) |
Resolves the given name relative to this path.
|
Path |
absolutePath(Path path) |
|
Path |
append(Path path) |
Appends the supplied path to this path, returning the new path.
|
Path |
child(String name) |
Creates a child of this path with the given name.
|
int |
compareTo(Path other) |
|
boolean |
equals(Object o) |
|
String |
getName() |
Returns the base name of this path, or null if this path is the root path.
|
Path |
getParent() |
Returns the parent of this path, or null if this path has no parent.
|
String |
getPath() |
|
int |
hashCode() |
|
boolean |
isAbsolute() |
|
static Path |
path(String path) |
|
String |
relativePath(String path) |
Calculates a path relative to this path.
|
Path |
relativePath(Path path) |
|
Path |
removeFirstSegments(int n) |
|
String |
segment(int index) |
|
int |
segmentCount() |
|
String |
toString() |
public static final Path ROOT
public static final String SEPARATOR
public Path append(Path path)
path(':a:b').append(path(':c:d')) == path(':a:b:c:d') path(':a:b').append(path('c:d')) == path(':a:b:c:d') path('a:b').append(path(':c:d')) == path('a:b:c:d') path('a:b').append(path('c:d')) == path('a:b:c:d')
public String getPath()
public int compareTo(Path other)
compareTo
in interface Comparable<Path>
@Nullable public Path getParent()
@Nullable public String getName()
public String absolutePath(String path)
public boolean isAbsolute()
public String relativePath(String path)
public int segmentCount()
public Path removeFirstSegments(int n)
public String segment(int index)