Example usage for org.apache.commons.collections4.map LRUMap mapIterator

List of usage examples for org.apache.commons.collections4.map LRUMap mapIterator

Introduction

In this page you can find the example usage for org.apache.commons.collections4.map LRUMap mapIterator.

Prototype

MapIterator<K, V> mapIterator();

Source Link

Document

Obtains a MapIterator over the map.

Usage

From source file:com.pungwe.db.io.store.InstanceCachingStore.java

private void flushCache() throws IOException {
    LRUMap<Long, Record<?>> current = cache;
    cache = new LRUMap<Long, Record<?>>(cacheSize);
    MapIterator<Long, Record<?>> it = current.mapIterator();
    while (it.hasNext()) {
        Long key = it.next();//from   w  w  w  . j av  a2 s  . c o m
        Record<Object> value = (Record<Object>) it.getValue();
        store.update(key, value.value, value.serializer);
    }
}