void doIt(BinaryTreeLeaf btl) { traverse.append(btl.getValue()); }
public void visitLeaf(Visitable node) { BinaryTreeLeaf leaf = (BinaryTreeLeaf) node; result += leaf.getValue(); }
void doIt(BinaryTreeLeaf btl) { sum += btl.getValue(); }