|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.internal.core.index.InMemoryIndex
public class InMemoryIndex
This index stores the document names in an ArrayList
, and the words in
an HashtableOfObjects
.
Field Summary | |
---|---|
protected IndexedFileHashedArray |
files
List of IndexedFiles = file name + a unique number. |
protected long |
footprint
Size of the index. |
protected List<WordEntry> |
words
hashtable of WordEntrys = words+numbers of the files they appear in. |
Constructor Summary | |
---|---|
InMemoryIndex()
|
Method Summary | |
---|---|
IndexedFile |
addDocument(IDocument document)
|
protected void |
addRef(char[] word,
int fileNum)
Looks if the word already exists in the index and add the fileNum to this word. |
void |
addRef(IndexedFile indexedFile,
char[] word)
|
long |
getFootprint()
Returns the footprint of the index. |
IndexedFile |
getIndexedFile(String path)
Returns the indexed file with the given path, or null if such file does not exist. |
int |
getNumFiles()
|
int |
getNumWords()
|
protected IndexedFile[] |
getSortedFiles()
Returns the words contained in the hashtable of words, sorted by alphabetical order. |
protected WordEntry[] |
getSortedWordEntries()
Returns the word entries contained in the hashtable of words, sorted by alphabetical order. |
void |
init()
Initialises the fields of the index |
protected void |
save(IndexOutput output)
Saves the index in the given IndexOutput. |
void |
save(org.jboss.virtual.VirtualFile file)
Saves the index in the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<WordEntry> words
protected IndexedFileHashedArray files
protected long footprint
Constructor Detail |
---|
public InMemoryIndex()
Method Detail |
---|
public IndexedFile addDocument(IDocument document)
protected void addRef(char[] word, int fileNum)
public void addRef(IndexedFile indexedFile, char[] word)
public long getFootprint()
public IndexedFile getIndexedFile(String path)
public int getNumFiles()
IIndex.getNumDocuments()
public int getNumWords()
IIndex.getNumWords()
protected IndexedFile[] getSortedFiles()
protected WordEntry[] getSortedWordEntries()
public void init()
public void save(org.jboss.virtual.VirtualFile file) throws IOException
IOException
protected void save(IndexOutput output) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |