|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pivot.collections.Sequence.Tree<T>
T - note that in Tree the type parameter currently it's not usedpublic static class Sequence.Tree<T>
Collection of static utility methods providing path access to nested sequence data.
| Nested Class Summary | |
|---|---|
static class |
Sequence.Tree.ImmutablePath
Class representing an immutable path. |
static interface |
Sequence.Tree.ItemIterator<T>
Nested sequence item iterator interface. |
static class |
Sequence.Tree.Path
An object representing a path to a nested node in nested sequence data. |
| Constructor Summary | |
|---|---|
Sequence.Tree()
|
|
| Method Summary | ||
|---|---|---|
static
|
add(Sequence<T> sequence,
T item,
Sequence.Tree.Path path)
Adds an item to a nested sequence. |
|
static
|
depthFirstIterator(Sequence<T> sequence)
Returns an iterator that will perform a depth-first traversal of the nested sequence. |
|
static
|
get(Sequence<T> sequence,
Sequence.Tree.Path path)
Retrieves an item from a nested sequence. |
|
static
|
insert(Sequence<T> sequence,
T item,
Sequence.Tree.Path path,
int index)
Inserts an item into a nested sequence. |
|
static boolean |
isDescendant(Sequence.Tree.Path ancestorPath,
Sequence.Tree.Path descendantPath)
Determines whether the path represented by the second argument is a descendant of the path represented by the first argument. |
|
static
|
pathOf(Sequence<T> sequence,
T item)
Returns the path to an item in a nested sequence. |
|
static
|
remove(Sequence<T> sequence,
Sequence.Tree.Path path,
int count)
Removes an item from a nested sequence. |
|
static
|
remove(Sequence<T> sequence,
T item)
Removes the first occurrence of an item from a nested sequence. |
|
static
|
update(Sequence<T> sequence,
Sequence.Tree.Path path,
T item)
Updates an item in a nested sequence. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Sequence.Tree()
| Method Detail |
|---|
public static <T> int add(Sequence<T> sequence,
T item,
Sequence.Tree.Path path)
sequence - The root sequence.item - The item to be added to the sequence.path - The path of the sequence to which the item should be added.
public static <T> void insert(Sequence<T> sequence,
T item,
Sequence.Tree.Path path,
int index)
sequence - The root sequence.item - The item to be inserted into the sequence.path - The path of the sequence into which the item should be inserted.index - The index at which the item should be inserted within the parent
sequence.
public static <T> T update(Sequence<T> sequence,
Sequence.Tree.Path path,
T item)
sequence - The root sequence.path - The path of the item to update.item - The item that will replace any existing value at the given path.
public static <T> Sequence.Tree.Path remove(Sequence<T> sequence,
T item)
sequence - The root sequence.item - The item to remove.
public static <T> Sequence<T> remove(Sequence<T> sequence,
Sequence.Tree.Path path,
int count)
sequence - The root sequence.path - The path of the item to remove.
public static <T> T get(Sequence<T> sequence,
Sequence.Tree.Path path)
sequence - The root sequence.path - The path of the item to retrieve.
public static <T> Sequence.Tree.Path pathOf(Sequence<T> sequence,
T item)
sequence - The root sequence.item - The item to locate.
public static <T> Sequence.Tree.ItemIterator<T> depthFirstIterator(Sequence<T> sequence)
public static boolean isDescendant(Sequence.Tree.Path ancestorPath,
Sequence.Tree.Path descendantPath)
ancestorPath - The ancestor path to test.descendantPath - The descendant path to test.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||