
public abstract class SortedFileMap<K extends Comparable<K>,V> extends Object implements Closeable
| Constructor and Description |
|---|
SortedFileMap(File file,
String mode) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
V |
get(K key) |
long |
getEntryCount() |
int |
getEntrySize() |
File |
getFile() |
K |
getKey(long index) |
abstract int |
getKeySize() |
K |
getMaxKey() |
long |
getPosition(long index) |
RandomAccessFile |
getRandomAccessFile() |
V |
getValue(long index) |
long |
getValuePosition(long index) |
abstract int |
getValueSize() |
V |
put(K key,
V value) |
protected abstract K |
readKey(ExtendedDataInput in) |
protected abstract V |
readValue(ExtendedDataInput in) |
protected long |
search(K key) |
protected abstract void |
writeKey(ExtendedDataOutput out,
K key) |
protected abstract void |
writeValue(ExtendedDataOutput out,
V value) |
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic File getFile()
public RandomAccessFile getRandomAccessFile()
public long getEntryCount()
public int getEntrySize()
public long getPosition(long index)
public long getValuePosition(long index)
public K getMaxKey()
public K getKey(long index)
public V getValue(long index)
protected long search(K key) throws IOException
-(insertionIndex + 1) otherwise.IOExceptionpublic abstract int getKeySize()
protected abstract K readKey(ExtendedDataInput in) throws IOException
IOExceptionprotected abstract void writeKey(ExtendedDataOutput out, K key) throws IOException
IOExceptionpublic abstract int getValueSize()
protected abstract V readValue(ExtendedDataInput in) throws IOException
IOExceptionprotected abstract void writeValue(ExtendedDataOutput out, V value) throws IOException
IOExceptionCopyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.