Package org.ujmp.core.collections.map
Class AbstractDiskMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.ujmp.core.collections.map.AbstractMap<K,V>
-
- org.ujmp.core.collections.map.AbstractDiskMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Map<K,V>
,Erasable
- Direct Known Subclasses:
SerializedObjectMap
,TextMap
public abstract class AbstractDiskMap<K,V> extends AbstractMap<K,V> implements Erasable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxDepth
private java.io.File
path
private static long
serialVersionUID
private boolean
useGZip
-
Constructor Summary
Constructors Constructor Description AbstractDiskMap(java.io.File path, boolean useGZip)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
void
erase()
V
get(java.lang.Object key)
private java.io.File
getFileNameForKey(java.lang.Object o)
private K
getKeyForFile(java.io.File file)
java.io.File
getPath()
java.util.Set<K>
keySet()
private void
listFilesToSet(java.io.File path, java.util.Set<K> set)
V
put(K key, V value)
abstract V
readValue(java.io.InputStream is)
V
remove(java.lang.Object key)
void
setPath(java.io.File path)
int
size()
abstract void
writeValue(java.io.OutputStream os, V value)
-
Methods inherited from class org.ujmp.core.collections.map.AbstractMap
beforeReadObject, beforeWriteObject, containsValue, entrySet, get, getAsString, isEmpty, putAll, toString, values
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
path
private java.io.File path
-
useGZip
private boolean useGZip
-
maxDepth
private int maxDepth
-
-
Method Detail
-
getPath
public final java.io.File getPath()
-
size
public final int size()
-
getFileNameForKey
private final java.io.File getFileNameForKey(java.lang.Object o) throws java.io.IOException
- Throws:
java.io.IOException
-
remove
public final V remove(java.lang.Object key)
-
containsKey
public final boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<K,V>
- Overrides:
containsKey
in classAbstractMap<K,V>
-
keySet
public final java.util.Set<K> keySet()
-
listFilesToSet
private void listFilesToSet(java.io.File path, java.util.Set<K> set) throws java.lang.ClassNotFoundException, java.io.IOException
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
-
getKeyForFile
private K getKeyForFile(java.io.File file) throws java.lang.ClassNotFoundException, java.io.IOException
- Throws:
java.lang.ClassNotFoundException
java.io.IOException
-
clear
public final void clear()
-
erase
public final void erase() throws java.io.IOException
-
setPath
public final void setPath(java.io.File path)
-
get
public final V get(java.lang.Object key)
-
writeValue
public abstract void writeValue(java.io.OutputStream os, V value)
-
readValue
public abstract V readValue(java.io.InputStream is)
-
-