Sha256: ff17b0d6c329c0534c8b43fbbebf0271b61eeb1aa2ac5163c7f29e11e422502a

Contents?: true

Size: 973 Bytes

Versions: 13

Compression:

Stored size: 973 Bytes

Contents

# -*- coding: utf-8 -*-
module TreeRb
  #
  # Callback methods used to visit a tree
  # Are empty so it is possible to define only a subset when deriving subclass
  #
  class BasicTreeNodeVisitor

    #
    # called on tree node at start of the visit i.e. we start to visit the subtree
    #
    def enter_node( tree_node )
    end

    #
    # called when the tree node is not accessible or an exception is raise when the node is accessed
    #
    def cannot_enter_node( tree_node, error)
    end

    # alias :enter_tree_node :enter_node

    #
    # called on tree node at end of the visit i.e. oll subtree are visited
    #
    def exit_node( tree_node )
    end

    # alias :exit_tree_node :exit_node

    #
    # called when visit leaf node
    #
    def visit_leaf( leaf_node )
    end

    #
    # called when the leaf node is not accessible or an exception is raise when the node is accessed
    #
    def cannot_visit_leaf( tree_node, error)
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
tree.rb-0.3.13 lib/tree_rb/core/basic_tree_node_visitor.rb
tree.rb-0.3.12 lib/tree_rb/core/basic_tree_node_visitor.rb
tree.rb-0.3.11 lib/tree_rb/core/basic_tree_node_visitor.rb
tree.rb-0.3.10 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.9 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.8 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.7 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.6 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.5 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.4 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.3 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.2 lib/tree_rb/basic_tree_node_visitor.rb
tree.rb-0.3.1 lib/tree_rb/basic_tree_node_visitor.rb