lux.compiler
Class SlopCounter

java.lang.Object
  extended by lux.xpath.ExpressionVisitor
      extended by lux.xpath.ExpressionVisitorBase
          extended by lux.compiler.SlopCounter

public class SlopCounter
extends ExpressionVisitorBase

adds up the number of wildcard ("*" or node()) path steps on the left or right-hand side of a path; descendant axis steps count as an infinite number of wildcard steps. The path distance underlying this function expresses the "vertical" distance between two sets of nodes. This is really only defined for expressions separated by some combination of self, child, and descendant steps, and it counts the number of wildcard (*, node()) steps.


Constructor Summary
SlopCounter()
           
 
Method Summary
 Integer getSlop()
           
 boolean isDone()
           
 void reset()
          reset back to the initial state so the counter may be reused.
 AbstractExpression visit(BinaryOperation exp)
           
 AbstractExpression visit(FunCall f)
           
 AbstractExpression visit(PathStep step)
           
 AbstractExpression visit(Root root)
           
 AbstractExpression visit(Sequence seq)
           
 
Methods inherited from class lux.xpath.ExpressionVisitorBase
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitDefault, visitSubs
 
Methods inherited from class lux.xpath.ExpressionVisitor
isReverse, setReverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlopCounter

public SlopCounter()
Method Detail

reset

public void reset()
reset back to the initial state so the counter may be reused.


visit

public AbstractExpression visit(Root root)
Overrides:
visit in class ExpressionVisitorBase

visit

public AbstractExpression visit(PathStep step)
Overrides:
visit in class ExpressionVisitorBase

visit

public AbstractExpression visit(FunCall f)
Overrides:
visit in class ExpressionVisitorBase

visit

public AbstractExpression visit(Sequence seq)
Overrides:
visit in class ExpressionVisitorBase

visit

public AbstractExpression visit(BinaryOperation exp)
Overrides:
visit in class ExpressionVisitorBase

getSlop

public Integer getSlop()

isDone

public boolean isDone()
Overrides:
isDone in class ExpressionVisitor
Returns:
true if the visit is done; this allows visits to terminate early


Copyright © 2013. All Rights Reserved.