Package org.anchoranalysis.io.input.path
Class ExtractPathElementRange
Object
ExtractPathElementRange
Extracts a range of elements from a
Path.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pathextract(Path path, IndexRangeNegative range) Extracts a sub-path from aPathby only retaining a range of elements.
-
Method Details
-
extract
Extracts a sub-path from aPathby only retaining a range of elements.The name-elements are a split of the
Pathby the directory-separator. See thePathJavadoc.All indices begin at 0 (for the first element), and can also accept negative-indices which count backwards from the end.
e.g. -1 is the last element; -2 is the second-last element.
- Parameters:
path- the path to find a sub-path for.range- which elements to include or not.- Returns:
- a newly created
Pathcontaining only the elements ofpathin the sub-range. - Throws:
DerivePathException- if the range contains invalid indices.
-