org.apache.pig.impl.eval
Class EvalSpecVisitor

java.lang.Object
  extended by org.apache.pig.impl.eval.EvalSpecVisitor
Direct Known Subclasses:
EvalSpecPrinter, EvalSpecTreePrinter

public abstract class EvalSpecVisitor
extends Object

A visitor mechanism for navigating and operating on a tree of EvalSpecs. This class contains the logic to navigate thre tree, but does not do anything with or to the tree. In order to operate on or extract information from the tree, extend this class. You only need to implement the methods dealing with the eval specs you are concerned with. For example, if you wish to find every FilterSpec and perform some operation on it, your visitor would look like: class MyEvalSpecVisitor extends EvalSpecVisitor { public void visitFilter(FilterSpec f) { you're logic here } } Any specs that you do not implement the visitX method for will then be navigated through by this class. *NOTE* When envoking a visitor, you should never call one of the methods in this class. You should pass your visitor as an argument to visit() on the object you want to visit. So: RIGHT: FilterSpec myFilter; MyVisitor v; myFilter.visit(v); WRONG: FilterSpec myFilter; MyVisitor v; v.visitFilter(myFilter); These methods are only public to make them accessible to the EvalSpec objects.


Constructor Summary
EvalSpecVisitor()
           
 
Method Summary
 void visitBinCond(BinCondSpec bc)
          Only BinCondSpec.visit() and subclass implementations of this function should ever call this method.
 void visitCompositeEval(CompositeEvalSpec ce)
          Only CompositeEvalSpec.visit() and subclass implementations of this function should ever call this method.
 void visitConst(ConstSpec c)
          Only ConstSpec.visit() and subclass implementations of this function should ever call this method.
 void visitFilter(FilterSpec f)
          Only FilterSpec.visit() and subclass implementations of this function should ever call this method.
 void visitFuncEval(FuncEvalSpec fe)
          Only FuncEvalSpec.visit() and subclass implementations of this function should ever call this method.
 void visitGenerate(GenerateSpec g)
          Only GenerateSpec.visit() and subclass implementations of this function should ever call this method.
 void visitMapLookup(MapLookupSpec ml)
          Only MapLookupSpec.visit() and subclass implementations of this function should ever call this method.
 void visitProject(ProjectSpec p)
          Only ProjectSpec.visit() and subclass implementations of this function should ever call this method.
 void visitSortDistinct(SortDistinctSpec sd)
          Only SortDistinctSpec.visit() and subclass implementations of this function should ever call this method.
 void visitStar(StarSpec s)
          Only StarSpec.visit() and subclass implementations of this function should ever call this method.
 void visitStream(StreamSpec stream)
          Only StreamSpec.visit() and subclass implementations of this function should ever call this method.
 void visitTimeWindow(TimeWindowSpec tw)
          Only TimeWindowSpec.visit() and subclass implementations of this function should ever call this method.
 void visitTupleWindow(TupleWindowSpec tw)
          Only TupleWindowSpec.visit() and subclass implementations of this function should ever call this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvalSpecVisitor

public EvalSpecVisitor()
Method Detail

visitFilter

public void visitFilter(FilterSpec f)
Only FilterSpec.visit() and subclass implementations of this function should ever call this method.


visitSortDistinct

public void visitSortDistinct(SortDistinctSpec sd)
Only SortDistinctSpec.visit() and subclass implementations of this function should ever call this method.


visitGenerate

public void visitGenerate(GenerateSpec g)
Only GenerateSpec.visit() and subclass implementations of this function should ever call this method.


visitMapLookup

public void visitMapLookup(MapLookupSpec ml)
Only MapLookupSpec.visit() and subclass implementations of this function should ever call this method.


visitConst

public void visitConst(ConstSpec c)
Only ConstSpec.visit() and subclass implementations of this function should ever call this method.


visitProject

public void visitProject(ProjectSpec p)
Only ProjectSpec.visit() and subclass implementations of this function should ever call this method.


visitStar

public void visitStar(StarSpec s)
Only StarSpec.visit() and subclass implementations of this function should ever call this method.


visitFuncEval

public void visitFuncEval(FuncEvalSpec fe)
Only FuncEvalSpec.visit() and subclass implementations of this function should ever call this method.


visitCompositeEval

public void visitCompositeEval(CompositeEvalSpec ce)
Only CompositeEvalSpec.visit() and subclass implementations of this function should ever call this method.


visitBinCond

public void visitBinCond(BinCondSpec bc)
Only BinCondSpec.visit() and subclass implementations of this function should ever call this method.


visitTimeWindow

public void visitTimeWindow(TimeWindowSpec tw)
Only TimeWindowSpec.visit() and subclass implementations of this function should ever call this method.


visitTupleWindow

public void visitTupleWindow(TupleWindowSpec tw)
Only TupleWindowSpec.visit() and subclass implementations of this function should ever call this method.


visitStream

public void visitStream(StreamSpec stream)
Only StreamSpec.visit() and subclass implementations of this function should ever call this method.



Copyright © ${year} The Apache Software Foundation