/**
 *  PrintAction class:
 *  The PrintAction class implements the NodeVisitor interface,
 *  printing the contents of the node to System.out.
 *
 *  @author Alyce Brady
 *  Creation Date: Spring 2001
 */


public class PrintAction<T> implements NodeVisitor<T>
{
    public PrintAction ()
    {
    }

    /** {@inheritDoc}
     *  This visitor prints the contents of each node it visits.
     */
    @Override
    public void visit(T data)
    {
        if ( data != null )
            System.out.println (data.toString());
    }

}
