Klasse IntegerCache
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.codegen.IntegerCache
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructs a new, empty hashtable.IntegerCache(int initialCapacity) Constructs a new, empty hashtable with the specified initial capacity. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclear()Clears the hash table so that it has no more elements in it.booleancontainsKey(int key) Returns true if the collection contains an element for the key.inthash(int key) Return a hashcode for the value of the key parameter.intput(int key, int value) Puts the specified element into the hashtable, using the specified key.intputIfAbsent(int key, int value) Puts the specified element into the hashtable if absent, using the specified key.intsize()Returns the number of elements contained in the hashtable.toString()Converts to a rather lengthy String.
-
Felddetails
-
keyTable
public int[] keyTable -
valueTable
public int[] valueTable
-
-
Konstruktordetails
-
IntegerCache
public IntegerCache()Constructs a new, empty hashtable. A default capacity and load factor is used. Note that the hashtable will automatically grow when it gets full. -
IntegerCache
public IntegerCache(int initialCapacity) Constructs a new, empty hashtable with the specified initial capacity.- Parameter:
initialCapacity- int the initial number of buckets
-
-
Methodendetails
-
clear
public void clear()Clears the hash table so that it has no more elements in it. -
containsKey
public boolean containsKey(int key) Returns true if the collection contains an element for the key.- Parameter:
key-doublethe key that we are looking for- Gibt zurück:
- boolean
-
hash
public int hash(int key) Return a hashcode for the value of the key parameter.- Parameter:
key- int- Gibt zurück:
- int the hash code corresponding to the key value
-
put
public int put(int 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.- Parameter:
key-intthe specified key in the hashtablevalue-intthe specified element- Gibt zurück:
- int value
-
putIfAbsent
public int putIfAbsent(int key, int value) Puts the specified element into the hashtable if absent, using the specified key. The element may be retrieved by doing a get() with the same key.- Parameter:
key-intthe specified key in the hashtablevalue-intthe specified element- Gibt zurück:
- int value
-
size
public int size()Returns the number of elements contained in the hashtable.- Gibt zurück:
intThe size of the table
-
toString
Converts to a rather lengthy String.
-