• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package ds.tree;
2 
3 
4 /**
5  * A simple standard implementation for a {@link visitor}.
6  *
7  * @author Dennis Heidsiek
8  * @param <T,R>
9  */
10 public abstract class VisitorImpl<T, R> implements Visitor<T, R> {
11 
12     protected R result;
13 
VisitorImpl()14     public VisitorImpl() {
15         this.result = null;
16     }
17 
VisitorImpl(R initialValue)18     public VisitorImpl(R initialValue) {
19         this.result = initialValue;
20     }
21 
getResult()22     public R getResult() {
23         return result;
24     }
25 
visit(String key, RadixTreeNode<T> parent, RadixTreeNode<T> node)26     abstract public void visit(String key, RadixTreeNode<T> parent, RadixTreeNode<T> node);
27 }