public class IndexedFileWordMap extends WordMap
| Constructor and Description |
|---|
IndexedFileWordMap(boolean onlyFiles)
Creates a new instance of IndexedFileWordMap
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(HEntry entry)
Add a new entry to WordMap.
|
void |
addCustomWord(String word) |
void |
beginAddEntries(int nEntries)
Called to notice the begin of a add series of calls
|
void |
endAddEntries(int nEntries)
Called when all no custom word wre added.
|
HEntry |
get(String word) |
protected HEntry |
getEntry(int index) |
protected HEntry |
getEntryFromPosition(long position) |
protected long |
getEntryPosition(int index) |
protected String |
getWord(int index) |
protected int |
getWordIndex(String word) |
void |
init(long lastModificationTime,
String wordMapName,
String encoding)
initialize the word map for example from a cache file, it can compare the dates to know if needEntries.
|
Iterator<HEntry> |
iterator() |
boolean |
needEntries()
The word map need the entries of the file.
|
public IndexedFileWordMap(boolean onlyFiles)
onlyFiles - No memory index is created. All operations are with files, so so there is less waste of memory, but poor perfomance.public void init(long lastModificationTime,
String wordMapName,
String encoding)
throws IOException
WordMapinit in class WordMapIOExceptionpublic boolean needEntries()
WordMapneedEntries in class WordMappublic void beginAddEntries(int nEntries)
throws IOException
WordMapbeginAddEntries in class WordMapIOExceptionpublic void endAddEntries(int nEntries)
throws IOException
WordMapendAddEntries in class WordMapIOExceptionpublic void add(HEntry entry) throws IOException
WordMapinit must be called firstadd in class WordMapIOExceptionprotected long getEntryPosition(int index)
protected int getWordIndex(String word)
protected String getWord(int index)
protected HEntry getEntry(int index)
protected HEntry getEntryFromPosition(long position)
public void addCustomWord(String word) throws IOException
addCustomWord in class WordMapIOExceptionCopyright © 2020. All rights reserved.