org.openjena.atlas.lib.cache
Class CacheSync<Key,T>

java.lang.Object
  extended by org.openjena.atlas.lib.cache.CacheSync<Key,T>
All Implemented Interfaces:
Cache<Key,T>

public class CacheSync<Key,T>
extends Object
implements Cache<Key,T>


Constructor Summary
CacheSync(Cache<Key,T> cache)
           
 
Method Summary
 void clear()
           
 boolean containsKey(Key key)
          Does the cache contain the key?
 T get(Key key)
          Get from cache - or return null.
 boolean isEmpty()
           
 Iterator<Key> keys()
          Iterate over all keys.
 T put(Key key, T thing)
          Insert into from cache and return old value (or null if none)
 boolean remove(Key key)
          Remove from cache - return true if key referenced an entry
 void setDropHandler(ActionKeyValue<Key,T> dropHandler)
          Register a callback - called when an object is dropped from the cache (optional operation)
 long size()
          Current size of cache
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheSync

public CacheSync(Cache<Key,T> cache)
Method Detail

clear

public void clear()
Specified by:
clear in interface Cache<Key,T>

containsKey

public boolean containsKey(Key key)
Description copied from interface: Cache
Does the cache contain the key?

Specified by:
containsKey in interface Cache<Key,T>

get

public T get(Key key)
Description copied from interface: Cache
Get from cache - or return null. Implementations should state whether they are thread-safe or not.

Specified by:
get in interface Cache<Key,T>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Cache<Key,T>

keys

public Iterator<Key> keys()
Description copied from interface: Cache
Iterate over all keys. Iteratering over the keys requires the caller be thread-safe.

Specified by:
keys in interface Cache<Key,T>

put

public T put(Key key,
             T thing)
Description copied from interface: Cache
Insert into from cache and return old value (or null if none)

Specified by:
put in interface Cache<Key,T>

remove

public boolean remove(Key key)
Description copied from interface: Cache
Remove from cache - return true if key referenced an entry

Specified by:
remove in interface Cache<Key,T>

setDropHandler

public void setDropHandler(ActionKeyValue<Key,T> dropHandler)
Description copied from interface: Cache
Register a callback - called when an object is dropped from the cache (optional operation)

Specified by:
setDropHandler in interface Cache<Key,T>

size

public long size()
Description copied from interface: Cache
Current size of cache

Specified by:
size in interface Cache<Key,T>


Licenced under the Apache License, Version 2.0