|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.osmosis.core.store.IndexStoreReader<K,T>
K
- The index key type.T
- The object type being stored.public class IndexStoreReader<K,T extends IndexElement<K>>
Provides read-only access to an index store. Each thread accessing the object store must create its own reader. The reader maintains all references to heavyweight resources such as file handles used to access the store eliminating the need for objects such as object iterators to be cleaned up explicitly.
Constructor Summary | |
---|---|
IndexStoreReader(RandomAccessObjectStoreReader<T> indexStoreReader,
java.util.Comparator<K> ordering)
Creates a new instance. |
Method Summary | |
---|---|
T |
get(K key)
Returns the index element identified by id. |
java.util.Iterator<T> |
getRange(K beginKey,
K endKey)
Returns all elements in the range specified by the begin and end keys. |
void |
release()
Performs resource cleanup tasks such as closing files, or database connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexStoreReader(RandomAccessObjectStoreReader<T> indexStoreReader, java.util.Comparator<K> ordering)
indexStoreReader
- Provides access to the index data.ordering
- A comparator that sorts index elements desired index key
ordering.Method Detail |
---|
public T get(K key)
key
- The identifier for the index element to be retrieved.
public java.util.Iterator<T> getRange(K beginKey, K endKey)
beginKey
- The key marking the beginning of the required index elements.endKey
- The key marking the end of the required index elements. The
identifier for the index element to be retrieved.
public void release()
release
in interface Releasable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |