public class TriePool extends Object implements Disposable
Used by the BaseList The
DetectorDataSet must be disposed of to ensure the readers in the pool are
closed.
| Modifier and Type | Field and Description |
|---|---|
private Queue<TrieReader> |
readers |
private TrieSource |
source |
| Constructor and Description |
|---|
TriePool(TrieSource source)
Constructs a new pool of readers for the source provided.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
TrieReader |
getReader()
Returns a reader to the temp file for exclusive use.
|
void |
release(TrieReader reader)
Returns the reader to the pool to be used by another process later.
|
private final Queue<TrieReader> readers
private final TrieSource source
public TriePool(TrieSource source)
source - The data source for the listpublic TrieReader getReader() throws IOException
IOExceptionpublic void release(TrieReader reader)
reader - Reader open and ready to read from the temp filepublic void dispose()
dispose in interface Disposable