lux.xpath
Class Subsequence

java.lang.Object
  extended by lux.xpath.AbstractExpression
      extended by lux.xpath.Subsequence
All Implemented Interfaces:
Visitable

public class Subsequence
extends AbstractExpression

represents numeric literal predicates like [1]; last-predicates like [last()] and calls to the subsequence(expr,integer,integer) function.

Author:
sokolov

Nested Class Summary
 
Nested classes/interfaces inherited from class lux.xpath.AbstractExpression
AbstractExpression.Type
 
Field Summary
 
Fields inherited from class lux.xpath.AbstractExpression
subs, sup
 
Constructor Summary
Subsequence(AbstractExpression sequence, AbstractExpression start)
           
Subsequence(AbstractExpression sequence, AbstractExpression start, AbstractExpression length)
           
 
Method Summary
 AbstractExpression accept(ExpressionVisitor visitor)
           
 AbstractExpression getLengthExpr()
           
 int getPrecedence()
           
 AbstractExpression getRoot()
           
 AbstractExpression getSequence()
           
 AbstractExpression getStartExpr()
           
 void setLengthExpr(AbstractExpression ae)
           
 void setSequence(AbstractExpression ae)
           
 void setStartExpr(AbstractExpression ae)
           
 void toString(StringBuilder buf)
          Each subclass must implement the toString(StringBuilder) method by rendering itself as a syntatically valid XPath/XQuery expression in the given buffer.
 
Methods inherited from class lux.xpath.AbstractExpression
acceptSubs, appendSub, getBindingContext, getLastContextStep, getSubs, getSuper, getTail, getType, isAbsolute, isDocumentOrdered, replaceRoot, setSubs, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Subsequence

public Subsequence(AbstractExpression sequence,
                   AbstractExpression start,
                   AbstractExpression length)

Subsequence

public Subsequence(AbstractExpression sequence,
                   AbstractExpression start)
Method Detail

accept

public AbstractExpression accept(ExpressionVisitor visitor)

getSequence

public AbstractExpression getSequence()

setSequence

public void setSequence(AbstractExpression ae)

getStartExpr

public AbstractExpression getStartExpr()

setStartExpr

public void setStartExpr(AbstractExpression ae)

getLengthExpr

public AbstractExpression getLengthExpr()

setLengthExpr

public void setLengthExpr(AbstractExpression ae)
Parameters:
ae - the expression to use as the length expression
Throws:
ArrayIndexOutOfBoundsException - if there wasn't already a length expression

getRoot

public AbstractExpression getRoot()
Overrides:
getRoot in class AbstractExpression
Returns:
the root of this expression: this will either be a Root(/), a function returning document nodes, or null.

getPrecedence

public int getPrecedence()
Specified by:
getPrecedence in class AbstractExpression
Returns:
the precedence of comma (,) or predicate ([]), depending on the child expressions.

toString

public void toString(StringBuilder buf)
Description copied from class: AbstractExpression
Each subclass must implement the toString(StringBuilder) method by rendering itself as a syntatically valid XPath/XQuery expression in the given buffer.

Specified by:
toString in class AbstractExpression


Copyright © 2013. All Rights Reserved.