Class LongCache
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.codegen.LongCache
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the hash table so that it has no more elements in it.booleancontainsKey(long key) Returns true if the collection contains an element for the key.inthash(long key) Return a hashcode for the value of the key parameter.intput(long key, int value) Puts the specified element into the hashtable, using the specified key.intputIfAbsent(long key, int value) Puts the specified element into the hashtable, using the specified key.intsize()Returns the number of elements contained in the hashtable.toString()Converts to a rather lengthy String.
-
Field Details
-
keyTable
public long[] keyTable -
valueTable
public int[] valueTable
-
-
Constructor Details
-
LongCache
public LongCache()Constructs a new, empty hashtable. A default capacity and load factor is used. Note that the hashtable will automatically grow when it gets full. -
LongCache
public LongCache(int initialCapacity) Constructs a new, empty hashtable with the specified initial capacity.- Parameters:
initialCapacity- int the initial number of buckets
-
-
Method Details
-
clear
public void clear()Clears the hash table so that it has no more elements in it. -
containsKey
public boolean containsKey(long key) Returns true if the collection contains an element for the key.- Parameters:
key-longthe key that we are looking for- Returns:
- boolean
-
hash
public int hash(long key) Return a hashcode for the value of the key parameter.- Parameters:
key- long- Returns:
- int the hash code corresponding to the key value
-
put
public int put(long 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.- Parameters:
key-longthe specified key in the hashtablevalue-intthe specified element- Returns:
- int value
-
putIfAbsent
public int putIfAbsent(long 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.- Parameters:
key-longthe specified key in the hashtablevalue-intthe specified element- Returns:
- int value
-
size
public int size()Returns the number of elements contained in the hashtable.- Returns:
intThe size of the table
-
toString
-