class ValueDepthVisitor

Public Class Methods

new() click to toggle source
Calls superclass method BaseVisitor::new
# File lib/visitor/value_depth_visitor.rb, line 4
def initialize
  super
end

Public Instance Methods

preVisit(node) click to toggle source
# File lib/visitor/value_depth_visitor.rb, line 8
def preVisit(node)
  if (node.isInternal) then
    node.valueDepth = node.parent.valueDepth + node.incomingEdgeLength
  elsif (node.isLeaf) then
    node.valueDepth = Node::LEAF_DEPTH
  end
  return true
end