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 Closeable
close
in interface AutoCloseable
IOException
public 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.IOException
public abstract int getKeySize()
protected abstract K readKey(ExtendedDataInput in) throws IOException
IOException
protected abstract void writeKey(ExtendedDataOutput out, K key) throws IOException
IOException
public abstract int getValueSize()
protected abstract V readValue(ExtendedDataInput in) throws IOException
IOException
protected abstract void writeValue(ExtendedDataOutput out, V value) throws IOException
IOException
Copyright (c) 2011-2014 Eike Stepper (Berlin, Germany) and others.