org.basex.query.xpath.expr
Class FTSelect

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xpath.expr.Expr
          extended by org.basex.query.xpath.expr.FTArrayExpr
              extended by org.basex.query.xpath.expr.FTSelect

public final class FTSelect
extends FTArrayExpr

Fulltext position filter expression and FTTimes.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Sebastian Gath

Field Summary
 FTPosFilter ftpos
          FTPositionFilter.
 
Fields inherited from class org.basex.query.xpath.expr.FTArrayExpr
fto
 
Constructor Summary
FTSelect(FTArrayExpr e, FTPosFilter ftps)
          Constructor.
 
Method Summary
 boolean checkSumUp(FTPosFilter ftpos1)
          Checks if FTContains Expr could be summed up.
 FTArrayExpr comp(XPContext ctx)
          Optimizes the expression.
 Item eval(XPContext ctx)
          Evaluates the expression with the specified context set.
 FTArrayExpr getExpr()
          Getter for expr.
 FTArrayExpr indexEquivalent(XPContext ctx, Step curr, boolean seq)
          Returns an equivalent expression which accesses an index structure.
 boolean indexOptions(MetaData meta)
          Verifies if the fulltext query options comply with the index defaults.
 int indexSizes(XPContext ctx, Step curr, int min)
          Returns the number of results if this query is evaluated by an index.
 boolean more()
          Checks for more results.
 FTNode next(XPContext ctx)
          Returns the next ftquery result.
 boolean pos()
          Checks whether the result of the expression is negative.
 void setExpr(FTArrayExpr e)
          Setter expr.
 
Methods inherited from class org.basex.query.xpath.expr.FTArrayExpr
plan, toString, usesPos, usesSize
 
Methods inherited from class org.basex.query.xpath.expr.Expr
returnedValue, sameAs
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ftpos

public FTPosFilter ftpos
FTPositionFilter.

Constructor Detail

FTSelect

public FTSelect(FTArrayExpr e,
                FTPosFilter ftps)
Constructor.

Parameters:
e - expressions
ftps - FTPositionFilter
Method Detail

comp

public FTArrayExpr comp(XPContext ctx)
                 throws QueryException
Description copied from class: FTArrayExpr
Optimizes the expression.

Overrides:
comp in class FTArrayExpr
Parameters:
ctx - expression context
Returns:
optimized Expression
Throws:
QueryException - evaluation exception

pos

public boolean pos()
Description copied from class: FTArrayExpr
Checks whether the result of the expression is negative.

Overrides:
pos in class FTArrayExpr
Returns:
boolean

next

public FTNode next(XPContext ctx)
Description copied from class: FTArrayExpr
Returns the next ftquery result.

Overrides:
next in class FTArrayExpr
Parameters:
ctx - current context
Returns:
FTNode container for the next result

getExpr

public FTArrayExpr getExpr()
Getter for expr.

Returns:
expr FTArrayExpr

setExpr

public void setExpr(FTArrayExpr e)
Setter expr.

Parameters:
e - FTArrayExpr

more

public boolean more()
Description copied from class: FTArrayExpr
Checks for more results.

Overrides:
more in class FTArrayExpr
Returns:
boolean

eval

public Item eval(XPContext ctx)
          throws QueryException
Description copied from class: Expr
Evaluates the expression with the specified context set. Additionally provides a context

Specified by:
eval in class Expr
Parameters:
ctx - query context
Returns:
resulting XPathValue
Throws:
QueryException - evaluation exception

indexOptions

public boolean indexOptions(MetaData meta)
Description copied from class: FTArrayExpr
Verifies if the fulltext query options comply with the index defaults. Check where this method is overwritten to get more info.

Overrides:
indexOptions in class FTArrayExpr
Parameters:
meta - meta data
Returns:
result of check

indexEquivalent

public FTArrayExpr indexEquivalent(XPContext ctx,
                                   Step curr,
                                   boolean seq)
                            throws QueryException
Description copied from class: Expr
Returns an equivalent expression which accesses an index structure.

Overrides:
indexEquivalent in class FTArrayExpr
Parameters:
ctx - root
curr - location step
seq - flag for sequential evaluation
Returns:
Equivalent index-expression or null
Throws:
QueryException - evaluation exception

checkSumUp

public boolean checkSumUp(FTPosFilter ftpos1)
Checks if FTContains Expr could be summed up.

Parameters:
ftpos1 - FTPositionFilter second expr
Returns:
int

indexSizes

public int indexSizes(XPContext ctx,
                      Step curr,
                      int min)
Description copied from class: Expr
Returns the number of results if this query is evaluated by an index. If Integer.MAX_VALUE is returned, no index access is possible.

Overrides:
indexSizes in class Expr
Parameters:
ctx - root
curr - the current location step
min - current minimum index hits
Returns:
number of expected results