K - The IKey typepublic interface IRegion<K extends IKey<K>>
extends java.io.Closeable
IKeyProvider.
Stores all values within a fixed measure (usually area or volume) of keys (locations).
Regions are used as a way of *chunking* the database.| Modifier and Type | Method and Description |
|---|---|
void |
forEachKey(CheckedConsumer<? super K,java.io.IOException> cons)
Applies the consumer to all existing region keys
|
boolean |
hasValue(K key)
Returns true if something was stored there before within this region.
|
java.util.Optional<java.nio.ByteBuffer> |
readValue(K key)
Loads a value at a key if there was something stored there before, within this region
|
void |
writeSpecial(K key,
java.lang.Object marker) |
void |
writeValue(K key,
java.nio.ByteBuffer value)
Stores a value at a key within this region
|
void writeValue(K key, java.nio.ByteBuffer value) throws java.io.IOException
key - A key within this regionvalue - The value to store. Null to remove existing value.UnsupportedDataException - if the data cannot be written due to internal constraints of the storage format. The stored data must remain
unchanged after this exception is thrownjava.io.IOExceptionvoid writeSpecial(K key, java.lang.Object marker) throws java.io.IOException
java.io.IOExceptionjava.util.Optional<java.nio.ByteBuffer> readValue(K key) throws java.io.IOException
key - The key within this regionkey if it existsjava.io.IOExceptionboolean hasValue(K key)
void forEachKey(CheckedConsumer<? super K,java.io.IOException> cons) throws java.io.IOException
java.io.IOException