org.mapdb
Class LongMap<V>

java.lang.Object
  extended by org.mapdb.LongMap<V>
Direct Known Subclasses:
LongConcurrentHashMap, LongConcurrentLRUMap, LongHashMap

public abstract class LongMap<V>
extends Object

Same as 'java.util.Map' but uses primitive 'long' keys to minimise boxing (and GC) overhead.

Author:
Jan Kotek

Nested Class Summary
static interface LongMap.LongMapIterator<V>
          Iterates over LongMap key and values without boxing long keys
 
Constructor Summary
LongMap()
           
 
Method Summary
abstract  void clear()
          Removes all mappings from this hash map, leaving it empty.
abstract  V get(long key)
          Returns the value of the mapping with the specified key.
abstract  boolean isEmpty()
          Returns whether this map is empty.
abstract  LongMap.LongMapIterator<V> longMapIterator()
           
abstract  V put(long key, V value)
          Maps the specified key to the specified value.
abstract  V remove(long key)
          Removes the mapping from this map
abstract  int size()
          Returns the number of elements in this map.
 String toString()
           
abstract  Iterator<V> valuesIterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongMap

public LongMap()
Method Detail

clear

public abstract void clear()
Removes all mappings from this hash map, leaving it empty.

See Also:
isEmpty(), size()

get

public abstract V get(long key)
Returns the value of the mapping with the specified key.

Parameters:
key - the key.
Returns:
the value of the mapping with the specified key, or null if no mapping for the specified key is found.

isEmpty

public abstract boolean isEmpty()
Returns whether this map is empty.

Returns:
true if this map has no elements, false otherwise.
See Also:
size()

put

public abstract V put(long key,
                      V value)
Maps the specified key to the specified value.

Parameters:
key - the key.
value - the value.
Returns:
the value of any previous mapping with the specified key or null if there was no such mapping.

remove

public abstract V remove(long key)
Removes the mapping from this map

Parameters:
key - to remove
Returns:
value contained under this key, or null if value did not exist

size

public abstract int size()
Returns the number of elements in this map.

Returns:
the number of elements in this map.

valuesIterator

public abstract Iterator<V> valuesIterator()
Returns:
iterator over values in map

longMapIterator

public abstract LongMap.LongMapIterator<V> longMapIterator()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.