Class RangeCache<C extends Comparable<C>,V>

java.lang.Object
org.aksw.commons.cache.plain.RangeCache<C,V>
Type Parameters:
K -
V -

public class RangeCache<C extends Comparable<C>,V> extends Object
An extension of loading cache that allows for making explicit references to cached entries such that they won't be evicted. As long as an entry's reference is not released the cache entry will not be evicted.
Author:
raven
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.google.common.cache.Cache<com.google.common.collect.Range<C>,V>
     
    protected com.google.common.collect.RangeSet<C>
     
    protected com.google.common.collect.RangeMap<C,Ref<V>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RangeCache(com.google.common.cache.CacheBuilder<com.google.common.collect.Range<C>,V> cacheBuilder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.collect.RangeMap<C,Ref<V>>
    claimAll(com.google.common.collect.Range<C> requestRange)
    Claim all items in the given request range
    void
    put(com.google.common.collect.Range<C> key, V value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • cache

      protected com.google.common.cache.Cache<com.google.common.collect.Range<C extends Comparable<C>>,V> cache
    • cacheKeys

      protected com.google.common.collect.RangeSet<C extends Comparable<C>> cacheKeys
    • claimed

      protected com.google.common.collect.RangeMap<C extends Comparable<C>,Ref<V>> claimed
  • Constructor Details

    • RangeCache

      public RangeCache(com.google.common.cache.CacheBuilder<com.google.common.collect.Range<C>,V> cacheBuilder)
  • Method Details

    • put

      public void put(com.google.common.collect.Range<C> key, V value)
    • claimAll

      public com.google.common.collect.RangeMap<C,Ref<V>> claimAll(com.google.common.collect.Range<C> requestRange)
      Claim all items in the given request range