|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.spi.commons.name.HashCache<T>
public class HashCache<T>
Simple utility class that implements a fixed-size and thread-safe (non-blocking) cache of objects. The cache is simply an array of objects, indexed by their hash codes. If more than one objects hash to the same location, only the most recently accessed object is kept in the cache.
https://issues.apache.org/jira/browse/JCR-1663
Constructor Summary | |
---|---|
HashCache()
Creates a hash cache with 1024 slots. |
|
HashCache(int exponent)
Creates a hash cache with 2^ exponent slots. |
Method Summary | |
---|---|
T |
get(T object)
If a cached copy of the given object already exists, then returns that copy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashCache()
public HashCache(int exponent)
exponent
slots.
exponent
- the exponent.Method Detail |
---|
public T get(T object)
object
- object to return from the cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |