public abstract class SortedFileMap<K extends java.lang.Comparable<K>,V>
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
SortedFileMap(java.io.File file,
java.lang.String mode) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
V |
get(K key) |
long |
getEntryCount() |
int |
getEntrySize() |
java.io.File |
getFile() |
K |
getKey(long index) |
abstract int |
getKeySize() |
K |
getMaxKey() |
long |
getPosition(long index) |
java.io.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 SortedFileMap(java.io.File file, java.lang.String mode)
RandomAccessFile.RandomAccessFile(File, String)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.io.File getFile()
public java.io.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 java.io.IOException
-(insertionIndex + 1)
otherwise.java.io.IOException
public abstract int getKeySize()
protected abstract K readKey(ExtendedDataInput in) throws java.io.IOException
java.io.IOException
protected abstract void writeKey(ExtendedDataOutput out, K key) throws java.io.IOException
java.io.IOException
public abstract int getValueSize()
protected abstract V readValue(ExtendedDataInput in) throws java.io.IOException
java.io.IOException
protected abstract void writeValue(ExtendedDataOutput out, V value) throws java.io.IOException
java.io.IOException
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html