Class ContextBranch

java.lang.Object
pro.verron.officestamper.core.ContextBranch
All Implemented Interfaces:
ContextTree

public class ContextBranch extends Object implements ContextTree
A branch in the context tree.
  • Constructor Details

    • ContextBranch

      public ContextBranch(ContextRoot tree, Object root)
      Constructs a ContextBranch with a single root object.
      Parameters:
      tree - the context root tree.
      root - the root object of the branch.
    • ContextBranch

      public ContextBranch(ContextRoot tree, List<Object> branch)
      Constructs a ContextBranch with a list of objects forming the branch.
      Parameters:
      tree - the context root tree.
      branch - the list of objects in the branch.
  • Method Details

    • addBranch

      public String addBranch(Object object)
      Adds a new branch with the given object.
      Specified by:
      addBranch in interface ContextTree
      Parameters:
      object - the object to add to the branch.
      Returns:
      the key of the added branch.
    • root

      public Object root()
      Returns the root object of the branch.
      Returns:
      the root object.
    • list

      public List<Object> list()
      Returns the list of objects in the branch, in reverse order.
      Returns:
      the list of objects.
    • toString

      public String toString()
      Overrides:
      toString in class Object