public class SegmentConstantPoolArrayCache extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
SegmentConstantPoolArrayCache.CachedArray
CachedArray keeps track of the last known size of an array as well as a HashMap that knows the mapping from
element values to the indices of the array which contain that value.
|
Modifier and Type | Field and Description |
---|---|
protected IdentityHashMap<String[],SegmentConstantPoolArrayCache.CachedArray> |
knownArrays |
protected String[] |
lastArray |
protected List<Integer> |
lastIndexes |
protected String |
lastKey |
Constructor and Description |
---|
SegmentConstantPoolArrayCache() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
arrayIsCached(String[] array)
Given a String array, answer true if the array is correctly cached.
|
protected void |
cacheArray(String[] array)
Cache the array passed in as the argument
|
List<Integer> |
indexesForArrayKey(String[] array,
String key)
Answer the indices for the given key in the given array.
|
protected IdentityHashMap<String[],SegmentConstantPoolArrayCache.CachedArray> knownArrays
protected List<Integer> lastIndexes
public SegmentConstantPoolArrayCache()
public List<Integer> indexesForArrayKey(String[] array, String key)
array
- String[] array to search for the valuekey
- String value for which to searchprotected boolean arrayIsCached(String[] array)
array
- of Stringprotected void cacheArray(String[] array)
array
- String[] to cacheCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.