Class RadixTreeImpl.VisitorImpl<T,​R>

  • Type Parameters:
    T - The RadixTree value type
    R - The result type of this visitor
    All Implemented Interfaces:
    RadixTreeImpl.Visitor<T,​R>
    Enclosing class:
    RadixTreeImpl<T>

    public abstract static class RadixTreeImpl.VisitorImpl<T,​R>
    extends java.lang.Object
    implements RadixTreeImpl.Visitor<T,​R>
    A simple standard implementation for a RadixTreeImpl.Visitor
    Author:
    Dennis Heidsiek, stm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean ready  
      protected R result  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      R getResult()
      The visitor can store any type of result object, depending on the context of what it is being used for.
      boolean isReady()  
      abstract void visit​(java.lang.String key, int alreadyMatched, java.lang.StringBuffer postfix, magellan.library.utils.RadixTreeImpl.RadixTreeNode<T> parent, magellan.library.utils.RadixTreeImpl.RadixTreeNode<T> node)
      This method gets called by visit when it finds a node matching the key given to it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • result

        protected R result
      • ready

        protected boolean ready
    • Constructor Detail

      • VisitorImpl

        public VisitorImpl()
      • VisitorImpl

        public VisitorImpl​(R initialValue)
    • Method Detail

      • getResult

        public R getResult()
        Description copied from interface: RadixTreeImpl.Visitor
        The visitor can store any type of result object, depending on the context of what it is being used for.
        Specified by:
        getResult in interface RadixTreeImpl.Visitor<T,​R>
        Returns:
        The result captured by the visitor.
      • visit

        public abstract void visit​(java.lang.String key,
                                   int alreadyMatched,
                                   java.lang.StringBuffer postfix,
                                   magellan.library.utils.RadixTreeImpl.RadixTreeNode<T> parent,
                                   magellan.library.utils.RadixTreeImpl.RadixTreeNode<T> node)
        Description copied from interface: RadixTreeImpl.Visitor
        This method gets called by visit when it finds a node matching the key given to it.
        Specified by:
        visit in interface RadixTreeImpl.Visitor<T,​R>
        Parameters:
        key - The key that matched the node
        parent - The parent of the node being visited
        node - The node that is being visited