Class FastIteratingContainer
java.lang.Object
org.castor.cache.hashbelt.container.FastIteratingContainer
The FastIteratingContainer implementation of the Container interface assuems two
things:
- Puts and removes are rare in proportion to gets and iteration are common. Put and remove are much more expensive here than in MapContainer.
- Keys will not be reused (using a key twice with different values implicitly does an expensive remove).
- Since:
- 1.0
- Version:
- $Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Gregory Block, Ralf Joachim
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()longReturns the timestamp of this container.booleanisEmpty()Returns an iterator over the keys contained in this container.keySet()voidintsize()voidSet the timestamp of this container to System.currentTimeMillis().Returns an iterator over the values contained in this container.values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
FastIteratingContainer
public FastIteratingContainer()
-
-
Method Details
-
updateTimestamp
public void updateTimestamp()Set the timestamp of this container to System.currentTimeMillis().- Specified by:
updateTimestampin interfaceContainer
-
getTimestamp
public long getTimestamp()Returns the timestamp of this container.- Specified by:
getTimestampin interfaceContainer- Returns:
- The timestamp.
-
keyIterator
Returns an iterator over the keys contained in this container. If the container is modified while an iteration is in progress, the results of the iteration is not affected and vice-versa.- Specified by:
keyIteratorin interfaceContainer- Returns:
- An iterator over the keys currently contained in the container.
-
valueIterator
Returns an iterator over the values contained in this container. If the container is modified while an iteration is in progress, the results of the iteration is not affected and vice-versa.- Specified by:
valueIteratorin interfaceContainer- Returns:
- An iterator over the values currently contained in the container.
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<Object,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<Object,Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-