@Immutable public class BasicPath extends AbstractPath
Path.Path.Segment| Modifier and Type | Field and Description |
|---|---|
static Path |
EMPTY_RELATIVE |
static Path |
PARENT_PATH |
static Path |
SELF_PATH |
EMPTY_PATH_ITERATORDEFAULT_DECODER, DEFAULT_ENCODER, DEFAULT_INDEX, DELIMITER, DELIMITER_STR, IDENTIFIER_LEADING_TERMINAL, IDENTIFIER_TRAILING_TERMINAL, JSR283_DECODER, JSR283_ENCODER, NO_OP_DECODER, NO_OP_ENCODER, PARENT, PARENT_NAME, PARENT_SEGMENT, ROOT_NAME, ROOT_PATH, SELF, SELF_NAME, SELF_SEGMENT, URL_DECODER, URL_ENCODER| Constructor and Description |
|---|
BasicPath(List<Path.Segment> segments,
boolean absolute) |
| Modifier and Type | Method and Description |
|---|---|
Path |
getAncestor(int degree)
Return the path to the ancestor of the supplied degree.
|
List<Path.Segment> |
getSegmentsList()
Get an unmodifiable list of the path segments.
|
protected Iterator<Path.Segment> |
getSegmentsOfParent()
Method used by
AbstractPath.equals(Object) implementation to quickly get an Iterator over the segments in the
parent. |
boolean |
isAbsolute()
Return whether this path is an absolute path.
|
boolean |
isNormalized()
Return whether this path is normalized and contains no unnecessary "." segments and as few ".." segments as possible.
|
boolean |
isRoot()
Return whether this path represents the root path.
|
int |
size()
Return the number of segments in this path.
|
compareTo, createSegmentsSubList, doGetString, endsWith, endsWith, equals, getCanonicalPath, getCommonAncestor, getLastSegment, getNormalizedPath, getParent, getSegment, getSegmentsArray, getString, getString, getString, getString, getString, hashCode, hasSameAncestor, isAncestorOf, isAtOrAbove, isAtOrBelow, isDescendantOf, isIdentifier, isNormalized, isSameAs, iterator, pathsFromRoot, relativeTo, relativeToRoot, resolve, resolveAgainst, subpath, subpath, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final Path EMPTY_RELATIVE
public static final Path SELF_PATH
public static final Path PARENT_PATH
public BasicPath(List<Path.Segment> segments, boolean absolute)
segments - the segmentsabsolute - true if this path is absolute, or false otherwisepublic Path getAncestor(int degree)
Pathx is the path that is x
levels up along the path. For example, degree = 0 returns this path, while degree = 1
returns the parent of this path, degree = 2 returns the grandparent of this path, and so on. Note that the
result may be unexpected if this path is not normalized, as a non-normalized path contains ".." and
"." segments.protected Iterator<Path.Segment> getSegmentsOfParent()
AbstractPathAbstractPath.equals(Object) implementation to quickly get an Iterator over the segments in the
parent.getSegmentsOfParent in class AbstractPathpublic List<Path.Segment> getSegmentsList()
Pathpublic boolean isAbsolute()
Pathabsolute. An absolute path
starts with a "/".public boolean isNormalized()
Pathpublic boolean isRoot()
Pathpublic int size()
PathCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.