org.apache.openjpa.lib.util.concurrent
Interface ConcurrentMap

All Superinterfaces:
java.util.Map
All Known Implementing Classes:
ConcurrentHashMap, ConcurrentReferenceHashMap

public interface ConcurrentMap
extends java.util.Map

A highly concurrent map.

Author:
Abe White

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 java.util.Iterator randomEntryIterator()
          Iterate over map entries, beginning at an arbitrary (not strictly random) entry.
 java.util.Map.Entry removeRandom()
          Remove an arbitrary(not strictly random) entry from the map.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

removeRandom

java.util.Map.Entry removeRandom()
Remove an arbitrary(not strictly random) entry from the map. This allows implementation of concurrent caches with size ceilings.

Returns:
the removed entry, or null if map is empty

randomEntryIterator

java.util.Iterator randomEntryIterator()
Iterate over map entries, beginning at an arbitrary (not strictly random) entry.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.