[jdom-interest] How to ease traversal of JDOM tree
Bradley S. Huffman
hip at a.cs.okstate.edu
Tue Nov 20 08:19:22 PST 2001
Laurent Bihanic writes:
>
> Bradley S. Huffman wrote:
> >
> > Why not a Visitor class (see the TODO list)?
> >
>
> Yes but visited objects are supposed to accept the Visitor. Gamma & al.
> actually propose to define an interface (thay call "Node" !) that defines the
> accept() method.
Which is a modeling construct to convey that each object in the sturcture
needs a method Accept( Vistor). That doesn't necessarily translate to
actual code. As along as each class implements a Accept method and the
Visitor method has a corresponding method for each class, we're okay.
More information about the jdom-interest
mailing list