private static class SourceNameMapper.SourceNameMapperCache
extends java.lang.Object
SourceNameMapper.fastConvertName(String)).
The propath is used for double-checking the cache when it is read.| Modifier and Type | Field and Description |
|---|---|
private LRUCache<java.lang.Integer,java.lang.String[]> |
convertedNames
A map of program indexes mapped to their target procedures.
|
private java.util.concurrent.locks.ReentrantReadWriteLock |
lock
Lock for read/write operations related to convertedNames.
|
private java.lang.String[] |
propath
Propath for which the cache was created
|
| Modifier | Constructor and Description |
|---|---|
private |
SourceNameMapperCache(java.lang.String[] propath,
LRUCache<java.lang.Integer,java.lang.String[]> convertedNames)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addResolvedProgram(java.lang.Integer programIndex,
java.lang.String[] result)
Add a new converted result of a program using the index of the program.
|
private java.lang.String[] |
getPropath()
Returns the propath of the cache.
|
private java.lang.String[] |
getResolvedProgram(java.lang.Integer programIndex)
Given an index of a program name, check if it is mapped to any target procedure and
return it if so.
|
private boolean |
hasProgram(java.lang.Integer programIndex)
Check if the given program name has an entry in the converted names map.
|
private void |
readLock()
Lock read operation.
|
private void |
readUnlock()
Unlock read operation.
|
private void |
writeLock()
Lock write operation.
|
private void |
writeUnlock()
Unlock write operation.
|
private java.lang.String[] propath
private LRUCache<java.lang.Integer,java.lang.String[]> convertedNames
SourceNameMapper.initializationPaths and
is used instead of the search-spec to reduce the number of Java Strings being used.private java.util.concurrent.locks.ReentrantReadWriteLock lock
private SourceNameMapperCache(java.lang.String[] propath,
LRUCache<java.lang.Integer,java.lang.String[]> convertedNames)
propath - The propath for which the cache is created.convertedNames - Initial map of indexed search-specs mapped to their target procedure.private java.lang.String[] getPropath()
private boolean hasProgram(java.lang.Integer programIndex)
programIndex - The index of the program name that is checked.true if the program was previously converted and has
an entry in the map, false otherwise.private java.lang.String[] getResolvedProgram(java.lang.Integer programIndex)
programIndex - The index of the program name that is searched.null if there is none;private void addResolvedProgram(java.lang.Integer programIndex,
java.lang.String[] result)
programIndex - The index of the program which is used as key.result - The result obtained from fastConvertName of the program.private void readLock()
private void readUnlock()
private void writeLock()
private void writeUnlock()