public interface StoreReader
PalDB.createReader()
method and then call the
get()
method to fetch. Call the
close()
to liberate resources when done.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the store reader and free resources.
|
<K> K |
get(java.lang.Object key)
Gets the value for
key or null if not found. |
<K> K |
get(java.lang.Object key,
K defaultValue)
Gets the value for
key or defaultValue if not found. |
<K> K[] |
getArray(java.lang.Object key)
Gets the object array value for
key or null if not found. |
<K> K[] |
getArray(java.lang.Object key,
K[] defaultValue)
Gets the object array value for
key or defaultValue if not found. |
boolean |
getBoolean(java.lang.Object key)
Gets the boolean value for
key . |
boolean |
getBoolean(java.lang.Object key,
boolean defaultValue)
Gets the boolean value for
key or defaultValue if not found. |
boolean[] |
getBooleanArray(java.lang.Object key)
Gets the boolean array value for
key . |
boolean[] |
getBooleanArray(java.lang.Object key,
boolean[] defaultValue)
Gets the boolean array value for
key or defaultValue if not found. |
byte |
getByte(java.lang.Object key)
Gets the byte value for
key . |
byte |
getByte(java.lang.Object key,
byte defaultValue)
Gets the byte value for
key or defaultValue if not found. |
byte[] |
getByteArray(java.lang.Object key)
Gets the byte array value for
key . |
byte[] |
getByteArray(java.lang.Object key,
byte[] defaultValue)
Gets the byte array value for
key or defaultValue if not found. |
char |
getChar(java.lang.Object key)
Gets the char value for
key . |
char |
getChar(java.lang.Object key,
char defaultValue)
Gets the char value for
key or defaultValue if not found. |
char[] |
getCharArray(java.lang.Object key)
Gets the char array value for
key . |
char[] |
getCharArray(java.lang.Object key,
char[] defaultValue)
Gets the char array value for
key or defaultValue if not found. |
Configuration |
getConfiguration()
Returns the reader's configuration.
|
double |
getDouble(java.lang.Object key)
Gets the double value for
key . |
double |
getDouble(java.lang.Object key,
double defaultValue)
Gets the double value for
key or defaultValue if not found. |
double[] |
getDoubleArray(java.lang.Object key)
Gets the double array value for
key . |
double[] |
getDoubleArray(java.lang.Object key,
double[] defaultValue)
Gets the double array value for
key or defaultValue if not found. |
java.io.File |
getFile()
Returns the store file.
|
float |
getFloat(java.lang.Object key)
Gets the float value for
key . |
float |
getFloat(java.lang.Object key,
float defaultValue)
Gets the float value for
key or defaultValue if not found. |
float[] |
getFloatArray(java.lang.Object key)
Gets the float array value for
key . |
float[] |
getFloatArray(java.lang.Object key,
float[] defaultValue)
Gets the float array value for
key or defaultValue if not found. |
int |
getInt(java.lang.Object key)
Gets the int value for
key . |
int |
getInt(java.lang.Object key,
int defaultValue)
Gets the int value for
key or defaultValue if not found. |
int[] |
getIntArray(java.lang.Object key)
Gets the int array value for
key . |
int[] |
getIntArray(java.lang.Object key,
int[] defaultValue)
Gets the int array value for
key or defaultValue if not found. |
long |
getLong(java.lang.Object key)
Gets the long value for
key . |
long |
getLong(java.lang.Object key,
long defaultValue)
Gets the long value for
key or defaultValue if not found. |
long[] |
getLongArray(java.lang.Object key)
Gets the long array value for
key . |
long[] |
getLongArray(java.lang.Object key,
long[] defaultValue)
Gets the long array value for
key or defaultValue if not found. |
short |
getShort(java.lang.Object key)
Gets the short value for
key . |
short |
getShort(java.lang.Object key,
short defaultValue)
Gets the short value for
key or defaultValue if not found. |
short[] |
getShortArray(java.lang.Object key)
Gets the short array value for
key . |
short[] |
getShortArray(java.lang.Object key,
short[] defaultValue)
Gets the short array value for
key or defaultValue if not found. |
java.lang.String |
getString(java.lang.Object key)
Gets the string value for
key or null if not found. |
java.lang.String |
getString(java.lang.Object key,
java.lang.String defaultValue)
Gets the string value for
key or defaultValue if not found. |
java.lang.String[] |
getStringArray(java.lang.Object key)
Gets the string array value for
key or null if not found. |
java.lang.String[] |
getStringArray(java.lang.Object key,
java.lang.String[] defaultValue)
Gets the string array value for
key or defaultValue if not found. |
<K,V> java.lang.Iterable<java.util.Map.Entry<K,V>> |
iterable()
Gets the store iterable.
|
<K> java.lang.Iterable<K> |
keys()
Gets the store keys iterable.
|
long |
size()
Returns the number of keys in the store.
|
void close()
A closed reader can't be reopened.
Configuration getConfiguration()
java.io.File getFile()
long size()
<K> K get(java.lang.Object key)
key
or null if not found.K
- return typekey
- key to fetch<K> K get(java.lang.Object key, K defaultValue)
key
or defaultValue
if not found.K
- return typekey
- key to fetchdefaultValue
- default valuedefaultValue
if not foundint getInt(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundint getInt(java.lang.Object key, int defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundlong getLong(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundlong getLong(java.lang.Object key, long defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundboolean getBoolean(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundboolean getBoolean(java.lang.Object key, boolean defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundfloat getFloat(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundfloat getFloat(java.lang.Object key, float defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not founddouble getDouble(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not founddouble getDouble(java.lang.Object key, double defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundshort getShort(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundshort getShort(java.lang.Object key, short defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundbyte getByte(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundbyte getByte(java.lang.Object key, byte defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundjava.lang.String getString(java.lang.Object key)
key
or null if not found.key
- key to fetchjava.lang.String getString(java.lang.Object key, java.lang.String defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundchar getChar(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundchar getChar(java.lang.Object key, char defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not found<K> K[] getArray(java.lang.Object key)
key
or null if not found.K
- return typekey
- key to fetch<K> K[] getArray(java.lang.Object key, K[] defaultValue)
key
or defaultValue
if not found.K
- return typekey
- key to fetchdefaultValue
- default valuedefaultValue
if not foundint[] getIntArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundint[] getIntArray(java.lang.Object key, int[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundlong[] getLongArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundlong[] getLongArray(java.lang.Object key, long[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundboolean[] getBooleanArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundboolean[] getBooleanArray(java.lang.Object key, boolean[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundfloat[] getFloatArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundfloat[] getFloatArray(java.lang.Object key, float[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not founddouble[] getDoubleArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not founddouble[] getDoubleArray(java.lang.Object key, double[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundshort[] getShortArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundshort[] getShortArray(java.lang.Object key, short[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundbyte[] getByteArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundbyte[] getByteArray(java.lang.Object key, byte[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundchar[] getCharArray(java.lang.Object key) throws NotFoundException
key
.key
- key to fetchNotFoundException
- if not foundchar[] getCharArray(java.lang.Object key, char[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not foundjava.lang.String[] getStringArray(java.lang.Object key) throws NotFoundException
key
or null if not found.key
- key to fetchNotFoundException
- if not foundjava.lang.String[] getStringArray(java.lang.Object key, java.lang.String[] defaultValue)
key
or defaultValue
if not found.key
- key to fetchdefaultValue
- default valuedefaultValue
if not found<K,V> java.lang.Iterable<java.util.Map.Entry<K,V>> iterable()
Note that entry objects are reused.
K
- key typeV
- value type<K> java.lang.Iterable<K> keys()
K
- key type