APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.classfile.impl

public final Class EntryMap

extends Object
Class Inheritance

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 getIndexByToken to get the mapped element or index.

Field Summary

Modifier and TypeField and Description
private int[]
data

Keys and values

private final float
fillFactor

Fill factor, must be between (0 and 1)

private int
mask1

Mask to calculate the original position

private int
public static final int
private int
resizeThreshold

We will resize a map once it reaches this size

private int
size

Current map size

Constructor Summary

AccessConstructor and Description
public
EntryMap(int size, float fillFactor)

Method Summary

Modifier and TypeMethod and Description
public static int
arraySize(final int expected, final float f)

public int
firstToken(int hash)

public int
getIndexByToken(int token)

public static long
public int
nextToken(int hash, int token)

public void
put(int hash, int index)

private void
rehash(final int newCapacity)

public int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private int[] data

Keys and values

fillFactorback to summary
private final float fillFactor

Fill factor, must be between (0 and 1)

mask1back to summary
private int mask1

Mask to calculate the original position

mask2back to summary
private int mask2
NO_VALUEback to summary
public static final int NO_VALUE
resizeThresholdback to summary
private int resizeThreshold

We will resize a map once it reaches this size

sizeback to summary
private int size

Current map size

Constructor Detail

EntryMapback to summary
public EntryMap(int size, float fillFactor)

Method Detail

arraySizeback to summary
public static int arraySize(final int expected, final float f)
firstTokenback to summary
public int firstToken(int hash)
getIndexByTokenback to summary
public int getIndexByToken(int token)
nextPowerOfTwoback to summary
public static long nextPowerOfTwo(long x)
nextTokenback to summary
public int nextToken(int hash, int token)
putback to summary
public void put(int hash, int index)
rehashback to summary
private void rehash(final int newCapacity)
sizeback to summary
public int size()