Example usage for org.apache.commons.collections SequencedHashMap size

List of usage examples for org.apache.commons.collections SequencedHashMap size

Introduction

In this page you can find the example usage for org.apache.commons.collections SequencedHashMap size.

Prototype

public int size() 

Source Link

Document

Implements Map#size() .

Usage

From source file:org.openlaszlo.cache.Cache.java

/**
 * Clear entries from given map//  w  w  w . j  av a  2 s . c o  m
 * @param map to clear
 */
private boolean clearMap(SequencedHashMap map) {

    boolean ok = true;
    while (map.size() > 0) {
        Map.Entry<?, ?> first = map.getFirst();
        Object key = first.getKey();
        Item item = (Item) first.getValue();
        item.lock();
        if (!item.removeAndUnlock()) {
            ok = false;
        }
        map.remove(key);
    }

    return ok;
}