public class VirtualTupleList extends Object implements Closeable
StringCTokenTuples.
Slightly slower than a simple in-memory sort, but capable of storing and
sorting very long lists without using large quantities of heap memory.Usage:
- Call add(java.lang.String, net.java.sen.dictionary.CToken) one or more times
- Call sort() once. Once the list has been sorted, it is no longer
valid to add new entries
- Call get(int) to retrieve entries from the sorted list
| Constructor and Description |
|---|
VirtualTupleList() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String string,
CToken ctoken)
Adds a StringCTokenTuple to the list.
|
void |
close() |
StringCTokenTuple |
get(int index)
Retrieves an entry from the list.
|
int |
size()
Returns the number of entries in the list
|
void |
sort()
Sorts the list
|
public VirtualTupleList()
throws IOException
IOExceptionpublic void add(String string, CToken ctoken) throws IOException
string - The stringctoken - The CTokenIOExceptionpublic StringCTokenTuple get(int index)
index - The index of the entry to retrievepublic void sort()
throws IOException
IOExceptionpublic int size()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException