LruCacheImpl<K, V> constructor

LruCacheImpl<K, V>(
  1. int maxSize
)

Constructs an LruCacheImpl with the specified maxSize.

Throws an assertion error if maxSize is not greater than 0.

Implementation

LruCacheImpl(int maxSize) {
  assert(maxSize > 0, 'maxSize must be greater than 0');
  this.maxSize = maxSize;
  this.map = LinkedHashMap<K, V>();
}