| java.lang.Object org.netbeans.modules.turbo.Memory
Memory | final class Memory (Code) | | Keeps entity key => attribute,value pairs without actually
holding key's reference. It supports several size strategies:
- minimal entry count (for caches with short lived keys),
- maximum entry count (for caches with long lived keys) and
- driven by key lifetime
It's synchronized for safety because at least
TrackingRef.run comes from private OpenAPI
thread.
author: Petr Kuzel |
Field Summary | |
final public static Object | NULL Special value, known null that does not invalidate but caches. | final public static ThreadLocal | prepared Keep reference to last isPrepared result. |
Constructor Summary | |
public | Memory(Statistics statistics, int minSize, int maxSize) Creates memory map with given strategy. |
NULL | final public static Object NULL(Code) | | Special value, known null that does not invalidate but caches.
|
prepared | final public static ThreadLocal prepared(Code) | | Keep reference to last isPrepared result.
|
Memory | public Memory(Statistics statistics, int minSize, int maxSize)(Code) | | Creates memory map with given strategy.
Parameters: minSize - minimum size Parameters: maxSize - maximum size or -1 for unbound sizedefined by key instance lifetime |
existsEntry | public synchronized boolean existsEntry(Object key, String name)(Code) | | Determines if given attribute has a cache entry.
Note that the entry can contain info that attribute
does not exist!
|
get | public synchronized Object get(Object key, String name)(Code) | | Looks for cached file atribute of given name.
Return stored attributes or null .
|
put | public synchronized void put(Object key, String name, Object value)(Code) | | Makes best efford to store file object attributes obtainable by next
Memory.get .
Parameters: value - updated value, null for removing memory entryor Memory.NULL for storing null value (it's known thatvalue does not exist) later returned by Memory.get. |
|
|