org.eclipse.jdt.internal.compiler.codegen
Class ObjectCache

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.codegen.ObjectCache

public class ObjectCache
extends java.lang.Object


Field Summary
 java.lang.Object[] keyTable
           
 int[] valueTable
           
 
Constructor Summary
ObjectCache()
          Constructs a new, empty hashtable.
ObjectCache(int initialCapacity)
          Constructs a new, empty hashtable with the specified initial capacity.
 
Method Summary
 void clear()
          Clears the hash table so that it has no more elements in it.
 boolean containsKey(java.lang.Object key)
          Returns true if the collection contains an element for the key.
 int get(java.lang.Object key)
          Gets the object associated with the specified key in the hashtable.
 int hashCode(java.lang.Object key)
          Return the hashcode for the key parameter
 int put(java.lang.Object key, int value)
          Puts the specified element into the hashtable, using the specified key.
 int size()
          Returns the number of elements contained in the hashtable.
 java.lang.String toString()
          Converts to a rather lengthy String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keyTable

public java.lang.Object[] keyTable

valueTable

public int[] valueTable
Constructor Detail

ObjectCache

public ObjectCache()
Constructs a new, empty hashtable. A default capacity is used. Note that the hashtable will automatically grow when it gets full.


ObjectCache

public ObjectCache(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity.

Parameters:
initialCapacity - int the initial number of buckets
Method Detail

clear

public void clear()
Clears the hash table so that it has no more elements in it.


containsKey

public boolean containsKey(java.lang.Object key)
Returns true if the collection contains an element for the key.

Parameters:
key - char[] the key that we are looking for
Returns:
boolean

get

public int get(java.lang.Object key)
Gets the object associated with the specified key in the hashtable.

Parameters:
key - char[] the specified key
Returns:
int the element for the key or -1 if the key is not defined in the hash table.

hashCode

public int hashCode(java.lang.Object key)
Return the hashcode for the key parameter

Parameters:
key - org.eclipse.jdt.internal.compiler.lookup.MethodBinding
Returns:
int

put

public int put(java.lang.Object key,
               int value)
Puts the specified element into the hashtable, using the specified key. The element may be retrieved by doing a get() with the same key. The key and the element cannot be null.

Parameters:
key - Object the specified key in the hashtable
value - int the specified element
Returns:
int the old value of the key, or -1 if it did not have one.

size

public int size()
Returns the number of elements contained in the hashtable.

Returns:
int The size of the table

toString

public java.lang.String toString()
Converts to a rather lengthy String.

Overrides:
toString in class java.lang.Object
Returns:
String the ascii representation of the receiver