org.basex.query
Class FTPos

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.FTPos

public class FTPos
extends ExprInfo

This class contains all ftcontains positions filters. It can be used by different query implementations. After calling the valid() method, distance(long, long) and window(long) must be called with query specific arguments.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Nested Class Summary
static class FTPos.FTUnit
          Units.
 
Field Summary
 boolean content
          Entire content flag.
 boolean different
          Different flag.
 FTPos.FTUnit dunit
          Distance unit.
 boolean end
          End flag.
 FTTokenizer ft
          Input token.
 boolean ordered
          Ordered flag.
 boolean same
          Same flag.
 FTPos.FTUnit sdunit
          Same/different unit.
 boolean start
          Start flag.
 TokenList term
          Term list.
 FTPos.FTUnit wunit
          Window unit.
 
Constructor Summary
FTPos()
           
 
Method Summary
 void add(byte[] t, IntList il)
          Adds the specified fulltext term and position list.
 boolean distance(long mn, long mx)
          Checks if the position values are ordered.
 IntList[] getPos()
          Get position values.
 void init(FTTokenizer tok)
          Initializes the select operator.
 boolean mildNot()
          Evaluates the mild not expression.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 void setPos(IntList[] il, int ilsize)
          Sets the position values and the number of tokens.
 java.lang.String toString()
           
 boolean valid()
          Performs common position tests.
 boolean window(long win)
          Checks if the specified window is correct.
 
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

ordered

public boolean ordered
Ordered flag.


start

public boolean start
Start flag.


end

public boolean end
End flag.


content

public boolean content
Entire content flag.


wunit

public FTPos.FTUnit wunit
Window unit.


dunit

public FTPos.FTUnit dunit
Distance unit.


same

public boolean same
Same flag.


different

public boolean different
Different flag.


sdunit

public FTPos.FTUnit sdunit
Same/different unit.


term

public TokenList term
Term list.


ft

public FTTokenizer ft
Input token.

Constructor Detail

FTPos

public FTPos()
Method Detail

init

public void init(FTTokenizer tok)
Initializes the select operator. Has to be called before any FTWords are performed.

Parameters:
tok - tokenizer for source term

add

public void add(byte[] t,
                IntList il)
Adds the specified fulltext term and position list. This method is called every time a test in FTOpt.contains(org.basex.index.FTTokenizer, org.basex.query.FTPos, byte[]) was successful.

Parameters:
t - term to be added
il - positions to be added

setPos

public void setPos(IntList[] il,
                   int ilsize)
Sets the position values and the number of tokens.

Parameters:
il - IntList[] with position values
ilsize - int number of tokens in query

valid

public boolean valid()
Performs common position tests. As distance(long, long) and window(long) have variable arguments, they have to be called on their own.

Returns:
result of check

distance

public boolean distance(long mn,
                        long mx)
Checks if the position values are ordered.

Parameters:
mn - minimum distance
mx - maximum distance
Returns:
result of check

window

public boolean window(long win)
Checks if the specified window is correct.

Parameters:
win - window value
Returns:
result of check

getPos

public IntList[] getPos()
Get position values.

Returns:
IntList pos values

mildNot

public boolean mildNot()
Evaluates the mild not expression.

Returns:
boolean result

plan

public void plan(Serializer ser)
          throws java.io.IOException
Description copied from class: ExprInfo
Recursively sends the abstract syntax of this expression to the specified serializer.

Specified by:
plan in class ExprInfo
Parameters:
ser - serializer
Throws:
java.io.IOException - exception

toString

public java.lang.String toString()
Specified by:
toString in class ExprInfo