Home | History | Annotate | Download | only in tree
      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 
     14     public VisitorImpl() {
     15         this.result = null;
     16     }
     17 
     18     public VisitorImpl(R initialValue) {
     19         this.result = initialValue;
     20     }
     21 
     22     public R getResult() {
     23         return result;
     24     }
     25 
     26     abstract public void visit(String key, RadixTreeNode<T> parent, RadixTreeNode<T> node);
     27 }