com.jalios.util
Class ObjectLongTreeMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap
          extended by com.jalios.util.ObjectLongTreeMap
All Implemented Interfaces:
Serializable, Cloneable, Map, SortedMap

public class ObjectLongTreeMap
extends TreeMap

This class is a map which binds key Object to long value.

Version:
$Revision: 14756 $
Author:
Olivier Dedieu
See Also:
Serialized Form

Field Summary
static String REVISION
           
 
Constructor Summary
ObjectLongTreeMap()
           
 
Method Summary
 long getLong(Object key, long defaultValue)
          Returns the value to which this map maps the specified key.
 void inc(Object key)
          Incremente the value associated with the specified key.
 void inc(Object key, long quantity)
          Incremente the value associated with the specified key.
 void put(Object key, long value)
          Associates the specified value with the specified key in this map.
 
Methods inherited from class java.util.TreeMap
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, put, putAll, remove, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

ObjectLongTreeMap

public ObjectLongTreeMap()
Method Detail

put

public void put(Object key,
                long value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.

Parameters:
key - key with which the specified value is to be associated.
value - value to be associated with the specified key.

inc

public void inc(Object key,
                long quantity)
Incremente the value associated with the specified key. If this key did not exist, it is created and the value is set to '1'.

Parameters:
key - key for which the specified value must be incremented.
quantity - the quantity to increment

inc

public void inc(Object key)
Incremente the value associated with the specified key. If this key did not exist, it is created and the value is set to '1'.

Parameters:
key - key for which the specified value must be incremented.

getLong

public long getLong(Object key,
                    long defaultValue)
Returns the value to which this map maps the specified key. Returns defaultValue if the map contains no mapping for this key.

Parameters:
key - key whose associated value is to be returned.
defaultValue - value to return if the map contains no mapping for this key.
Returns:
the value to which this map maps the specified key, or defaultValue if the map contains no mapping for this key.


Copyright © 2001-2007 Jalios SA. All Rights Reserved.