Key
- the type of keyValue
- the type of valuepublic interface NitriteMap<Key,Value> extends MetadataAware
Represents a Nitrite key-value pair map. Every piece of
data in a Nitrite database is stored in NitriteMap
.
Modifier and Type | Method and Description |
---|---|
Key |
ceilingKey(Key key)
Get the smallest key that is larger or equal to this key.
|
void |
clear()
Remove all entries in the map.
|
boolean |
containsKey(Key key)
Determines if the map contains a mapping for the
specified key.
|
java.util.Set<java.util.Map.Entry<Key,Value>> |
entrySet()
Gets a
Set view of the mappings contained in this map. |
Key |
floorKey(Key key)
Get the largest key that is smaller or equal to this key.
|
Value |
get(Key key)
Gets the value mapped with the specified key or
null otherwise. |
java.lang.String |
getName()
Gets name of this map.
|
NitriteStore |
getStore()
Gets the parent
NitriteStore where this map is stored. |
Key |
higherKey(Key key)
Get the smallest key that is larger than the given key, or null if no
such key exists.
|
boolean |
isEmpty()
Indicates whether the map is empty.
|
java.util.List<Key> |
keyList()
Returns the list of all keys in the map.
|
java.util.Set<Key> |
keySet()
Gets a
Set view of the keys contained in this map. |
Key |
lowerKey(Key key)
Get the largest key that is smaller than the given key, or null if no
such key exists.
|
void |
put(Key key,
Value value)
Associates the specified value with the specified key in this map.
|
Value |
putIfAbsent(Key key,
Value value)
Add a key-value pair if it does not yet exist.
|
Value |
remove(Key key)
Removes the mapping for a key from this map if it is present.
|
int |
size()
Get the number of entries, as a integer.
|
long |
sizeAsLong()
Get the number of entries, as a long.
|
java.util.Collection<Value> |
values()
Gets a
Collection view of the values contained in
this map. |
getAttributes, setAttributes
boolean containsKey(Key key)
Determines if the map contains a mapping for the specified key.
key
- key whose presence in this map is to be testedtrue
if this map contains a mapping for the specified key.Value get(Key key)
Gets the value mapped with the specified key or null
otherwise.
key
- the keynull
if the key not found.NitriteStore getStore()
Gets the parent NitriteStore
where this map is stored.
void clear()
Remove all entries in the map.
java.lang.String getName()
Gets name of this map.
java.util.Collection<Value> values()
Gets a Collection
view of the values contained in
this map.
Value remove(Key key)
Removes the mapping for a key from this map if it is present.
key
- the key whose mapping is to be removed from this map.java.util.Set<Key> keySet()
Gets a Set
view of the keys contained in this map.
void put(Key key, Value value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
key
- key with which the specified value is to be associated (may not be null).value
- value to be associated with the specified key (may not be null).int size()
Get the number of entries, as a integer. Integer.MAX_VALUE is returned if there are more than this entries.
long sizeAsLong()
Get the number of entries, as a long.
Value putIfAbsent(Key key, Value value)
Add a key-value pair if it does not yet exist.
key
- the key (may not be null)value
- the new valuenull
otherwise.java.util.Set<java.util.Map.Entry<Key,Value>> entrySet()
Gets a Set
view of the mappings contained in this map.
Key higherKey(Key key)
Get the smallest key that is larger than the given key, or null if no such key exists.
key
- the keyKey ceilingKey(Key key)
Get the smallest key that is larger or equal to this key.
key
- the keyKey lowerKey(Key key)
Get the largest key that is smaller than the given key, or null if no such key exists.
key
- the keyKey floorKey(Key key)
Get the largest key that is smaller or equal to this key.
key
- the keyboolean isEmpty()
Indicates whether the map is empty.
true
if the map is empty; false
otherwise.java.util.List<Key> keyList()
Returns the list of all keys in the map.