org.basex.data
Class FTMatches

java.lang.Object
  extended by org.basex.util.list.ElementList
      extended by org.basex.data.FTMatches
All Implemented Interfaces:
java.lang.Iterable<FTMatch>

public final class FTMatches
extends ElementList
implements java.lang.Iterable<FTMatch>

AllMatches full-text container, referencing several FTMatch instances.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 FTMatch[] match
          Full-text matches.
 int sTokenNum
          Current number of tokens.
 
Fields inherited from class org.basex.util.list.ElementList
factor, size
 
Constructor Summary
FTMatches(int s)
          Constructor.
 
Method Summary
 void add(FTMatch m)
          Adds a match entry.
 void and(int s, int e)
          Adds a match entry.
 FTMatches copy()
          Creates a deep copy of this container.
 void delete(int i)
          Removes the specified match.
 java.util.Iterator<FTMatch> iterator()
           
 boolean matches()
          Checks if at least one of the matches contains only includes.
 void or(int p)
          Adds a match entry.
 void or(int s, int e)
          Adds a match entry.
 boolean phrase(FTMatches all, int dis)
          Combines two matches as phrase.
 void reset(int s)
          Resets the match counter.
 java.lang.String toString()
           
 
Methods inherited from class org.basex.util.list.ElementList
isEmpty, newSize, newSize, reset, size, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

match

public FTMatch[] match
Full-text matches.


sTokenNum

public int sTokenNum
Current number of tokens.

Constructor Detail

FTMatches

public FTMatches(int s)
Constructor.

Parameters:
s - sets the token number
Method Detail

reset

public void reset(int s)
Resets the match counter.

Parameters:
s - sets the token number

or

public void or(int p)
Adds a match entry.

Parameters:
p - position

or

public void or(int s,
               int e)
Adds a match entry.

Parameters:
s - start position
e - end position

and

public void and(int s,
                int e)
Adds a match entry.

Parameters:
s - start position
e - end position

add

public void add(FTMatch m)
Adds a match entry.

Parameters:
m - match to be added

delete

public void delete(int i)
Removes the specified match.

Parameters:
i - match offset

matches

public boolean matches()
Checks if at least one of the matches contains only includes.

Returns:
result of check

phrase

public boolean phrase(FTMatches all,
                      int dis)
Combines two matches as phrase.

Parameters:
all - second match list
dis - word distance
Returns:
true if matches are left

iterator

public java.util.Iterator<FTMatch> iterator()
Specified by:
iterator in interface java.lang.Iterable<FTMatch>

copy

public FTMatches copy()
Creates a deep copy of this container.

Returns:
copy

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object