public class ToStringVisitor extends java.lang.Object implements Visitor<java.lang.String>
AccessStructure as a printable string.| Constructor and Description |
|---|
ToStringVisitor() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getResultOfCurrentNode()
Returns the value that was calculated during
Visitor.visit(TreeNode). |
Visitor<java.lang.String> |
getVisitorForNextChild()
Returns a visitor for the next child.
|
void |
putResultOfChild(java.lang.String input)
Inserts the result of the child of current node, so that the current
visitor can calculate its own value from it.
|
void |
visit(TreeNode currentNode)
Performs some kind of computation on the given
currentNode. |
public java.lang.String getResultOfCurrentNode()
throws WrongAccessStructureException
VisitorVisitor.visit(TreeNode).getResultOfCurrentNode in interface Visitor<java.lang.String>WrongAccessStructureException - if something is wrong with the access structure being traversedpublic Visitor<java.lang.String> getVisitorForNextChild() throws WrongAccessStructureException
VisitorgetVisitorForNextChild in interface Visitor<java.lang.String>WrongAccessStructureException - if something is wrong with the access structure being traversedpublic void putResultOfChild(java.lang.String input)
VisitorputResultOfChild in interface Visitor<java.lang.String>input - the result of visiting the child of the node currently being visitedpublic void visit(TreeNode currentNode) throws WrongAccessStructureException
VisitorcurrentNode.visit in interface Visitor<java.lang.String>currentNode - node of the threshold tree to visitWrongAccessStructureException - if something is wrong with the access structure being traversed