public class TreePath extends ArrayList<String>
Tree
. The path is expressed as a list of strings.modCount
Constructor and Description |
---|
TreePath()
Create an empty tree path.
|
TreePath(List<String> initialPathEntries)
Create a tree path from a list.
|
TreePath(String initialPathEntry,
String... args)
Create a tre path.
|
TreePath(TreePath initialPath,
String... args)
Create a tre path.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isEmptyPath(TreePath path)
Determines if a path is empty.
|
TreePath |
lastButOne()
Retrieves the a sub-section of this path from the first element to the second to last element.
|
TreePath |
subPath(int start,
int end)
Retrieves a subsection of the path.
|
String |
toString() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public TreePath()
public TreePath(List<String> initialPathEntries)
initialPathEntries
- Entries in the path.public TreePath(String initialPathEntry, String... args)
initialPathEntry
- The first entry in the path.args
- Additional path entries.public static boolean isEmptyPath(TreePath path)
path
- Path to test.true
if path
contains no entries, path
is null
, or if the first entry of
path
is null
or an empty string.public TreePath lastButOne()
public TreePath subPath(int start, int end)
start
- first index (inclusive) of the sub-pathend
- last index (exclusive) of the sub-pathstart
and end
.public String toString()
toString
in class AbstractCollection<String>