18#ifndef _DECAF_UTIL_LRUCACHE_H_
19#define _DECAF_UTIL_LRUCACHE_H_
42 template<
typename K,
typename V,
typename HASHCODE = HashCode<K> >
65 if (maximumCacheSize <= 0) {
67 __FILE__, __LINE__,
"Cache size must be greater than zero.");
90 if (maximumCacheSize <= 0) {
92 __FILE__, __LINE__,
"Cache size must be greater than zero.");
118 __FILE__, __LINE__,
"Cache size must be greater than zero.");
121 this->maxCacheSize =
size;
127 if (this->
size() > maxCacheSize) {
Definition IllegalArgumentException.h:31
virtual int size() const
Definition HashMap.h:953
float loadFactor
Definition HashMap.h:760
LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, bool accessOrder)
Constructs an empty LRUCache instance with the specified initial capacity, maximumCacheSize,...
Definition LRUCache.h:87
virtual ~LRUCache()
Definition LRUCache.h:96
int maxCacheSize
Definition LRUCache.h:46
void setMaxCacheSize(int size)
Sets the maximum size allowed for this LRU Cache.
Definition LRUCache.h:115
LRUCache()
Default constructor for an LRU Cache The default capacity is 10000.
Definition LRUCache.h:54
virtual bool removeEldestEntry(const MapEntry< K, V > &eldest DECAF_UNUSED)
This method is queried from the put and putAll methods to check if the eldest member of the map shoul...
Definition LRUCache.h:126
LRUCache(int maximumCacheSize)
Constructs a LRUCache with a maximum capacity.
Definition LRUCache.h:62
int getMaxCacheSize() const
Gets the currently configured Max Cache Size setting.
Definition LRUCache.h:103
LinkedHashMap()
Constructs an empty insertion-ordered LinkedHashMap instance with the default initial capacity (16) a...
Definition LinkedHashMap.h:609
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25