Example usage for org.apache.commons.collections.map LRUMap LRUMap

List of usage examples for org.apache.commons.collections.map LRUMap LRUMap

Introduction

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

Prototype

public LRUMap(Map map, boolean scanUntilRemovable) 

Source Link

Document

Constructor copying elements from another map.

Usage

From source file:org.lockss.crawler.CrawlManagerStatus.java

/** Return an LRUMap that prevents deletion of active crawls */
static LRUMap makeLRUMap(int histSize) {
    // scanUntilRemovable must be true to prevent map from slowly growing
    // without bound
    return new LRUMap(histSize, true) {
        protected boolean removeLRU(AbstractLinkedMap.LinkEntry entry) {
            return !((CrawlerStatus) entry.getValue()).isCrawlActive();
        }//from www .  ja v a2 s .  co m
    };
}