RISC JKU

at.jku.risc.stout.nau.util

Class Traversable.TraverseCallBack<T>

  • Enclosing interface:
    Traversable<T>


    public abstract static class Traversable.TraverseCallBack<T>
    extends Object
    This class may be used to traverse a term tree and execute an arbitrary operation on every node.The following example prints all variable occurences inside of a nominal term.
     term.traverse(new TraverseCallBack<NominalTerm>() {
            public boolean exec(NominalTerm term) {
                    if (term instanceof Suspension)
                            System.out.println(((Suspension) term).getVar());
                    return false;
            }
     });
     
    Author:
    Alexander Baumgartner
    • Constructor Detail

      • Traversable.TraverseCallBack

        public Traversable.TraverseCallBack()
    • Method Detail

      • exec

        public abstract boolean exec(T term)
        Forward propagation will stop as soon as this method returns true.
      • execBackward

        public boolean execBackward(T term)
        Traversing will stop as soon as this method returns true.