public final class ReaderImpl extends java.lang.Object implements StoreReader
| 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.
|
public void close()
StoreReaderA closed reader can't be reopened.
close in interface StoreReaderpublic long size()
StoreReadersize in interface StoreReaderpublic Configuration getConfiguration()
StoreReadergetConfiguration in interface StoreReaderpublic java.io.File getFile()
StoreReadergetFile in interface StoreReaderpublic <K> K get(java.lang.Object key)
StoreReaderkey or null if not found.get in interface StoreReaderK - return typekey - key to fetchpublic <K> K get(java.lang.Object key,
K defaultValue)
StoreReaderkey or defaultValue if not found.get in interface StoreReaderK - return typekey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic int getInt(java.lang.Object key,
int defaultValue)
StoreReaderkey or defaultValue if not found.getInt in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic int getInt(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getInt in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic long getLong(java.lang.Object key,
long defaultValue)
StoreReaderkey or defaultValue if not found.getLong in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic long getLong(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getLong in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic boolean getBoolean(java.lang.Object key,
boolean defaultValue)
StoreReaderkey or defaultValue if not found.getBoolean in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic boolean getBoolean(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getBoolean in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic float getFloat(java.lang.Object key,
float defaultValue)
StoreReaderkey or defaultValue if not found.getFloat in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic float getFloat(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getFloat in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic double getDouble(java.lang.Object key,
double defaultValue)
StoreReaderkey or defaultValue if not found.getDouble in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic double getDouble(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getDouble in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic short getShort(java.lang.Object key,
short defaultValue)
StoreReaderkey or defaultValue if not found.getShort in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic short getShort(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getShort in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic byte getByte(java.lang.Object key,
byte defaultValue)
StoreReaderkey or defaultValue if not found.getByte in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic byte getByte(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getByte in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic java.lang.String getString(java.lang.Object key,
java.lang.String defaultValue)
StoreReaderkey or defaultValue if not found.getString in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic java.lang.String getString(java.lang.Object key)
StoreReaderkey or null if not found.getString in interface StoreReaderkey - key to fetchpublic char getChar(java.lang.Object key,
char defaultValue)
StoreReaderkey or defaultValue if not found.getChar in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic char getChar(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getChar in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic <K> K[] getArray(java.lang.Object key)
StoreReaderkey or null if not found.getArray in interface StoreReaderK - return typekey - key to fetchpublic <K> K[] getArray(java.lang.Object key,
K[] defaultValue)
StoreReaderkey or defaultValue if not found.getArray in interface StoreReaderK - return typekey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic int[] getIntArray(java.lang.Object key,
int[] defaultValue)
StoreReaderkey or defaultValue if not found.getIntArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic int[] getIntArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getIntArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic long[] getLongArray(java.lang.Object key,
long[] defaultValue)
StoreReaderkey or defaultValue if not found.getLongArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic long[] getLongArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getLongArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic boolean[] getBooleanArray(java.lang.Object key,
boolean[] defaultValue)
StoreReaderkey or defaultValue if not found.getBooleanArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic boolean[] getBooleanArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getBooleanArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic float[] getFloatArray(java.lang.Object key,
float[] defaultValue)
StoreReaderkey or defaultValue if not found.getFloatArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic float[] getFloatArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getFloatArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic double[] getDoubleArray(java.lang.Object key,
double[] defaultValue)
StoreReaderkey or defaultValue if not found.getDoubleArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic double[] getDoubleArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getDoubleArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic short[] getShortArray(java.lang.Object key,
short[] defaultValue)
StoreReaderkey or defaultValue if not found.getShortArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic short[] getShortArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getShortArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic byte[] getByteArray(java.lang.Object key,
byte[] defaultValue)
StoreReaderkey or defaultValue if not found.getByteArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic byte[] getByteArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getByteArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic java.lang.String[] getStringArray(java.lang.Object key,
java.lang.String[] defaultValue)
StoreReaderkey or defaultValue if not found.getStringArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic java.lang.String[] getStringArray(java.lang.Object key)
StoreReaderkey or null if not found.getStringArray in interface StoreReaderkey - key to fetchpublic char[] getCharArray(java.lang.Object key,
char[] defaultValue)
StoreReaderkey or defaultValue if not found.getCharArray in interface StoreReaderkey - key to fetchdefaultValue - default valuedefaultValue if not foundpublic char[] getCharArray(java.lang.Object key)
throws NotFoundException
StoreReaderkey.getCharArray in interface StoreReaderkey - key to fetchNotFoundException - if not foundpublic <K,V> java.lang.Iterable<java.util.Map.Entry<K,V>> iterable()
StoreReaderNote that entry objects are reused.
iterable in interface StoreReaderK - key typeV - value typepublic <K> java.lang.Iterable<K> keys()
StoreReaderkeys in interface StoreReaderK - key type