public class PrecedenceTree<T> extends Object
A hash tree with easy to access preceding elements. Elements can be added in either order.
T
:
The type of a tree nodes.
Constructor and Description |
---|
PrecedenceTree(T rootMarker)
Initializes a new instance of the
PrecedenceTree{T} class. |
Modifier and Type | Method and Description |
---|---|
void |
add(T posterior,
T anterior)
Adds the (anterior -> posterior) pair to the tree.
|
SequencedDictionary<T,T> |
getLeaves()
Gets the leaves of the tree in order they were added.
|
T |
getPreceding(T posterior)
Gets preceding node from the tree.
|
T |
getRoot()
Gets the root of the tree.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> |
getSucceeding(T anterior)
Gets succeeding nodes from the tree.
|
public PrecedenceTree(T rootMarker)
Initializes a new instance of the PrecedenceTree{T}
class.
rootMarker
- The root marker.public T getRoot()
Gets the root of the tree.
public SequencedDictionary<T,T> getLeaves()
Gets the leaves of the tree in order they were added.
public void add(T posterior, T anterior)
Adds the (anterior -> posterior) pair to the tree.
posterior
- The posterior node.anterior
- The anterior node.public T getPreceding(T posterior)
Gets preceding node from the tree.
posterior
- The posterior node.Copyright (c) 2016 Aspose. All Rights Reserved.