java.lang.Object
org.glavo.classfile.impl.EntryMap<T>
An open-chain multimap used to map nonzero hashes to indexes (of either CP
elements or BSM entries). Code transformed from public domain implementation
(http://java-performance.info/).
The internal data structure is an array of 2N int elements, where the first
element is the hash and the second is the mapped index. To look something up
in the map, provide a hash value and an index to map it to, and invoke
firstToken(hash). This returns an opaque token that can be provided to
nextToken(hash, token) to get the next candidate, or to getElementByToken(token)
or getIndexByToken to get the mapped element or index.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intarraySize(int expected, float f) protected abstract TfetchElement(int index) intfirstToken(int hash) getElementByToken(int token) intgetIndexByToken(int token) static longnextPowerOfTwo(long x) intnextToken(int hash, int token) voidput(int hash, int index) intsize()
-
Field Details
-
NO_VALUE
public static final int NO_VALUE- See Also:
-
-
Constructor Details
-
EntryMap
public EntryMap(int size, float fillFactor)
-
-
Method Details
-
fetchElement
-
firstToken
public int firstToken(int hash) -
nextToken
public int nextToken(int hash, int token) -
getIndexByToken
public int getIndexByToken(int token) -
getElementByToken
-
put
public void put(int hash, int index) -
size
public int size() -
nextPowerOfTwo
public static long nextPowerOfTwo(long x) -
arraySize
public static int arraySize(int expected, float f)
-