Class RegexASTSubtreeRootNode

All Implemented Interfaces:
AbstractState<Term,ASTTransition>, RegexASTVisitorIterable, JsonConvertible
Direct Known Subclasses:
AtomicGroup, LookAroundAssertion, RegexASTRootNode

public abstract class RegexASTSubtreeRootNode extends Term implements RegexASTVisitorIterable
A common supertype to the root node, lookahead and lookbehind assertions and atomic groups. Every AST subtree contains a Group which contains the syntactic subtree, as well as a MatchFound node, which is needed for NFA-like traversal of the AST, see NFATraversalRegexASTVisitor.
  • Method Details

    • globalSubTreeIdInitialized

      public boolean globalSubTreeIdInitialized()
    • getGlobalSubTreeId

      public int getGlobalSubTreeId()
    • setGlobalSubTreeId

      public void setGlobalSubTreeId(int globalSubTreeId)
    • subTreeIdInitialized

      public boolean subTreeIdInitialized()
    • getSubTreeId

      public int getSubTreeId()
    • setSubTreeId

      public void setSubTreeId(int subTreeId)
    • getSubtrees

      public SubTreeIndex getSubtrees()
    • copy

      public abstract RegexASTSubtreeRootNode copy(RegexAST ast)
      Description copied from class: RegexASTNode
      Copy this node only, without any child nodes. The ID and minPath of the copied nodes is left unset.
      Specified by:
      copy in class Term
      Parameters:
      ast - RegexAST the node should belong to.
      Returns:
      A shallow copy of this node.
    • getGroup

      public Group getGroup()
      Returns the Group that represents the contents of this subtree.
    • setGroup

      public void setGroup(Group group)
      Sets the contents of this subtree.

      This method should be called after creating any instance of this class. Otherwise, methods of this class could throw NullPointerExceptions or return nulls.

    • getMatchFound

      public MatchFound getMatchFound()
      Returns this subtree's corresponding MatchFound node.
    • setMatchFound

      public void setMatchFound(MatchFound matchFound)
    • getAnchoredInitialState

      public Term getAnchoredInitialState()
    • setAnchoredInitialState

      public void setAnchoredInitialState(PositionAssertion anchoredInitialState)
    • getUnAnchoredInitialState

      public Term getUnAnchoredInitialState()
    • setUnAnchoredInitialState

      public void setUnAnchoredInitialState(MatchFound unAnchoredInitialState)
    • getAnchoredFinalState

      public Term getAnchoredFinalState()
    • setAnchoredFinalState

      public void setAnchoredFinalState(PositionAssertion anchoredFinalState)
    • visitorHasNext

      public boolean visitorHasNext()
      Specified by:
      visitorHasNext in interface RegexASTVisitorIterable
    • visitorGetNext

      public RegexASTNode visitorGetNext(boolean reverse)
      Specified by:
      visitorGetNext in interface RegexASTVisitorIterable
    • resetVisitorIterator

      public void resetVisitorIterator()
      Specified by:
      resetVisitorIterator in interface RegexASTVisitorIterable
    • getPrefix

      public abstract String getPrefix()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJson

      protected JsonObject toJson(String typeName)
      Overrides:
      toJson in class RegexASTNode