Klasse CharArrayCache
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CharArrayCache
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructs a new, empty hashtable.CharArrayCache(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(char[] key) Returns true if the collection contains an element for the key.intget(char[] key) Gets the object associated with the specified key in the hashtable.intputIfAbsent(char[] key, int value) Puts the specified element into the hashtable if it wasn't there already, using the specified key.voidremove(char[] key) Remove the object associated with the specified key in the hashtable.char[]returnKeyFor(int value) Returns the key corresponding to the value.intsize()Returns the number of elements contained in the hashtable.toString()Converts to a rather lengthy String.
-
Felddetails
-
keyTable
public char[][] keyTable -
valueTable
public int[] valueTable
-
-
Konstruktordetails
-
CharArrayCache
public CharArrayCache()Constructs a new, empty hashtable. A default capacity is used. Note that the hashtable will automatically grow when it gets full. -
CharArrayCache
public CharArrayCache(int initialCapacity) Constructs a new, empty hashtable with the specified initial capacity.- Parameter:
initialCapacity- int the initial number of buckets; must be less than Integer.MAX_VALUE / 2
-
-
Methodendetails
-
clear
public void clear()Clears the hash table so that it has no more elements in it. -
containsKey
public boolean containsKey(char[] key) Returns true if the collection contains an element for the key.- Parameter:
key- char[] the key that we are looking for- Gibt zurück:
- boolean
-
get
public int get(char[] key) Gets the object associated with the specified key in the hashtable.- Parameter:
key-char[]the specified key- Gibt zurück:
- int the element for the key or -1 if the key is not defined in the hash table.
-
putIfAbsent
public int putIfAbsent(char[] key, int value) Puts the specified element into the hashtable if it wasn't there already, 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.- Parameter:
key- the given key in the hashtablevalue- the given value- Gibt zurück:
- int the old value of the key, or -value if it did not have one.
-
remove
public void remove(char[] key) Remove the object associated with the specified key in the hashtable.- Parameter:
key-char[]the specified key
-
returnKeyFor
public char[] returnKeyFor(int value) Returns the key corresponding to the value. Returns null if the receiver doesn't contain the value.- Parameter:
value- int the value that we are looking for- Gibt zurück:
- Object
-
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. return String the ascii representation of the receiver
-