com.aspose.note.infrastructure

Class PrecedenceTree<T>



  • 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 Detail

      • PrecedenceTree

        public PrecedenceTree(T rootMarker)

        Initializes a new instance of the PrecedenceTree{T} class.

        Parameters:
        rootMarker - The root marker.
    • Method Detail

      • getRoot

        public T getRoot()

        Gets the root of the tree.

      • getLeaves

        public SequencedDictionary<T,T> getLeaves()

        Gets the leaves of the tree in order they were added.

      • add

        public void add(T posterior,
                        T anterior)

        Adds the (anterior -> posterior) pair to the tree.

        Parameters:
        posterior - The posterior node.
        anterior - The anterior node.
      • getPreceding

        public T getPreceding(T posterior)

        Gets preceding node from the tree.

        Parameters:
        posterior - The posterior node.
        Returns:
        The anterior node.
      • getSucceeding

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<T> getSucceeding(T anterior)

        Gets succeeding nodes from the tree.

        Parameters:
        anterior - The anterior node.
        Returns:
        The posterior nodes.