JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling.util
Class IdentityIntMap<T>

java.lang.Object
  extended by org.jboss.marshalling.util.IdentityIntMap<T>
All Implemented Interfaces:
Cloneable

public final class IdentityIntMap<T>
extends Object
implements Cloneable

An efficient identity object map whose keys are objects and whose values are ints.


Constructor Summary
IdentityIntMap()
          Construct a new instance with an initial capacity of 64 and a load factor of 0.5.
IdentityIntMap(float loadFactor)
          Construct a new instance with the given load factor and an initial capacity of 64.
IdentityIntMap(int initialCapacity)
          Construct a new instance with the given initial capacity and a load factor of 0.5.
IdentityIntMap(int initialCapacity, float loadFactor)
          Construct a new instance with the given initial capacity and load factor.
 
Method Summary
 void clear()
           
 IdentityIntMap<T> clone()
          Clone this map.
 int get(T key, int defVal)
          Get a value from the map.
 void put(T key, int value)
          Put a value into the map.
 String toString()
          Get a string summary representation of this map.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityIntMap

public IdentityIntMap(int initialCapacity,
                      float loadFactor)
Construct a new instance with the given initial capacity and load factor.

Parameters:
initialCapacity - the initial capacity
loadFactor - the load factor

IdentityIntMap

public IdentityIntMap(float loadFactor)
Construct a new instance with the given load factor and an initial capacity of 64.

Parameters:
loadFactor - the load factor

IdentityIntMap

public IdentityIntMap(int initialCapacity)
Construct a new instance with the given initial capacity and a load factor of 0.5.

Parameters:
initialCapacity - the initial capacity

IdentityIntMap

public IdentityIntMap()
Construct a new instance with an initial capacity of 64 and a load factor of 0.5.

Method Detail

clone

public IdentityIntMap<T> clone()
Clone this map.

Overrides:
clone in class Object
Returns:
a cloned map

get

public int get(T key,
               int defVal)
Get a value from the map.

Parameters:
key - the key
defVal - the value to return if the key is not found
Returns:
the map value at the given key, or the value of defVal if it's not found

put

public void put(T key,
                int value)
Put a value into the map. Any previous mapping is discarded silently.

Parameters:
key - the key
value - the value to store

clear

public void clear()

toString

public String toString()
Get a string summary representation of this map.

Overrides:
toString in class Object
Returns:
a string representation

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.