Constructor and Description |
---|
PersistentMap2(File file,
boolean synchronous,
ClassLoader classloader)
Creates the map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the entries from this map.
|
void |
close()
Closes the persistence file.
|
void |
compact()
Removes stale entries and compacts the map.
|
boolean |
containsKey(Object key)
Returns whether this map contains the specified
key.
|
boolean |
containsValue(Object value)
Returns whether the map contains the
specified value.
|
V |
doRemove(Object key) |
Set<Map.Entry<K,V>> |
entrySet()
Returns the map's entry set.
|
V |
get(Object key)
Returns the value for a specified key.
|
long |
getDirtyBytes()
Returns the bytes wasted due to stale entries.
|
boolean |
isEmpty()
Returns whether this map is empty.
|
Set<K> |
keySet()
Returns the keys of the map.
|
static void |
main(String[] args)
Test main method.
|
V |
put(K key,
V value)
Puts a new value in the map.
|
void |
putAll(Map<? extends K,? extends V> m)
Copies entries from the specified map to this map,
|
V |
remove(Object key)
Removes a map entry.
|
void |
setAutoCompactionThreshold(long threshold)
Sets the threshold of stale bytes
before auto-compaction is executed.
|
int |
size()
Returns the size of the map.
|
Collection<V> |
values()
Returns the values of the map.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public PersistentMap2(File file, boolean synchronous, ClassLoader classloader)
file
- File used for persistent data.public static void main(String[] args)
args
- Arguments.public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public void putAll(Map<? extends K,? extends V> m)
public void clear()
public Set<K> keySet()
public Collection<V> values()
public void compact()
public void close()
public long getDirtyBytes()
public void setAutoCompactionThreshold(long threshold)
Copyright © 2015. All Rights Reserved.