|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.teiid.internal.core.index.IndexSummary
public class IndexSummary
An indexSummary is used when saving an index into a BlocksIndexOuput or reading it from a BlocksIndexInput. It contains basic informations about an index: first files/words in each block, number of files/words.
| Field Summary | |
|---|---|
protected java.util.ArrayList |
firstFilesInBlocks
First file for each block. |
protected boolean |
firstWordAdded
|
protected int |
firstWordBlockNum
|
protected java.util.ArrayList |
firstWordsInBlocks
First word for each block. |
protected int |
numFiles
Number of files in the index. |
protected int |
numWords
Number of words in the index. |
| Constructor Summary | |
|---|---|
IndexSummary()
|
|
| Method Summary | |
|---|---|
void |
addFirstFileInBlock(IndexedFile indexedFile,
int blockNum)
Adds the given file as the first file for the given Block number. |
void |
addFirstWordInBlock(char[] word,
int blockNum)
Adds the given word as the first word for the given Block number. |
int[] |
getAllBlockNums()
Returns the numbers of all the blocks |
int |
getBlockNum(int blockLocation)
|
int |
getBlockNumForFileNum(int fileNum)
Returns the number of the Block containing the file with the given number. |
int |
getBlockNumForWord(char[] word)
Returns the number of the Block containing the given word. |
int[] |
getBlockNumsForPrefix(char[] prefix)
|
int |
getFirstBlockLocationForPrefix(char[] prefix)
|
int |
getFirstWordBlockNum()
Returns the number of the first IndexBlock (containing words). |
int |
getNextBlockLocationForPrefix(char[] prefix,
int blockLoc)
Blocks are contiguous, so the next one is a potential candidate if its first word starts with the given prefix |
int |
getNumFiles()
Returns the number of files contained in the index. |
int |
getNumWords()
Returns the number of words contained in the index. |
void |
read(java.io.RandomAccessFile raf)
Loads the summary in memory. |
void |
setNumFiles(int numFiles)
Sets the number of files of the index. |
void |
setNumWords(int numWords)
Sets the number of words of the index. |
void |
write(java.io.RandomAccessFile raf)
Saves the summary on the disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.ArrayList firstFilesInBlocks
protected java.util.ArrayList firstWordsInBlocks
protected int numFiles
protected int numWords
protected int firstWordBlockNum
protected boolean firstWordAdded
| Constructor Detail |
|---|
public IndexSummary()
| Method Detail |
|---|
public void addFirstFileInBlock(IndexedFile indexedFile,
int blockNum)
public void addFirstWordInBlock(char[] word,
int blockNum)
public int[] getAllBlockNums()
public int getBlockNum(int blockLocation)
public int getBlockNumForFileNum(int fileNum)
public int getBlockNumForWord(char[] word)
public int[] getBlockNumsForPrefix(char[] prefix)
public int getFirstBlockLocationForPrefix(char[] prefix)
public int getFirstWordBlockNum()
public int getNextBlockLocationForPrefix(char[] prefix,
int blockLoc)
public int getNumFiles()
public int getNumWords()
public void read(java.io.RandomAccessFile raf)
throws java.io.IOException
java.io.IOExceptionpublic void setNumFiles(int numFiles)
public void setNumWords(int numWords)
public void write(java.io.RandomAccessFile raf)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||