org.apache.jackrabbit.spi.commons.name
Class HashCache
java.lang.Object
org.apache.jackrabbit.spi.commons.name.HashCache
public class HashCache
- extends Object
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.
- See Also:
https://issues.apache.org/jira/browse/JCR-1663
Method Summary |
Object |
get(Object 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 |
HashCache
public HashCache()
get
public Object get(Object object)
- If a cached copy of the given object already exists, then returns
that copy. Otherwise the given object is cached and returned.
- Parameters:
object
- object to return from the cache
- Returns:
- the given object or a previously cached copy
Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.