org.basex.index
Class IndexArrayIterator

java.lang.Object
  extended by org.basex.index.IndexIterator
      extended by org.basex.index.IndexArrayIterator

public class IndexArrayIterator
extends IndexIterator

This interface provides methods for returning index results.

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

Field Summary
static IndexArrayIterator EMP
          Empty iterator.
 
Fields inherited from class org.basex.index.IndexIterator
EMPTY
 
Constructor Summary
IndexArrayIterator(int s)
          Constructor.
IndexArrayIterator(int[][] res, boolean c)
          Constructor.
IndexArrayIterator(int[][] res, int s, boolean c)
          Constructor.
IndexArrayIterator(int[] res, int s)
          Constructor.
 
Method Summary
 int[][] getFTData()
          Get all FTData from index.
static IndexArrayIterator merge(IndexArrayIterator iai1, IndexArrayIterator iai2)
          Merge to indexarrayiterator.
 boolean more()
          Checks if more results are available.
 int next()
          Returns the next result.
 FTNode nextFTNode()
          Get next FTNode.
 FTNode nextFTNodeFD()
          Returns the next result as FTNode object.
 void setToken(FTTokenizer[] token)
          Set FTTokinzer.
 void setTokenNum(int tn)
          Each token in the query has a number.
 int size()
          Returns the number of index results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMP

public static final IndexArrayIterator EMP
Empty iterator.

Constructor Detail

IndexArrayIterator

public IndexArrayIterator(int s)
Constructor.

Parameters:
s - size

IndexArrayIterator

public IndexArrayIterator(int[] res,
                          int s)
Constructor.

Parameters:
res - pres array
s - number of results

IndexArrayIterator

public IndexArrayIterator(int[][] res,
                          boolean c)
Constructor.

Parameters:
res - pres array
c - Flag for data converting

IndexArrayIterator

public IndexArrayIterator(int[][] res,
                          int s,
                          boolean c)
Constructor.

Parameters:
res - pres array
s - size
c - Flag for data converting
Method Detail

more

public boolean more()
Description copied from class: IndexIterator
Checks if more results are available.

Specified by:
more in class IndexIterator
Returns:
result

next

public int next()
Description copied from class: IndexIterator
Returns the next result.

Specified by:
next in class IndexIterator
Returns:
result

nextFTNodeFD

public FTNode nextFTNodeFD()
Description copied from class: IndexIterator
Returns the next result as FTNode object.

Specified by:
nextFTNodeFD in class IndexIterator
Returns:
next FTNode

nextFTNode

public FTNode nextFTNode()
Get next FTNode.

Returns:
FTNode next FTNode

size

public int size()
Description copied from class: IndexIterator
Returns the number of index results.

Specified by:
size in class IndexIterator
Returns:
size

setTokenNum

public void setTokenNum(int tn)
Each token in the query has a number. Used for visualization.

Parameters:
tn - number of tokens

setToken

public void setToken(FTTokenizer[] token)
Set FTTokinzer.

Parameters:
token - FTTokenizer

getFTData

public int[][] getFTData()
Get all FTData from index.

Returns:
int[][] ftdata

merge

public static IndexArrayIterator merge(IndexArrayIterator iai1,
                                       IndexArrayIterator iai2)
Merge to indexarrayiterator.

Parameters:
iai1 - first indexarrayiterator to merge
iai2 - second indexarrayiterator to merge
Returns:
IndexArrayIterator