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 TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
long
Returns the timestamp of this container.boolean
isEmpty()
Returns an iterator over the keys contained in this container.keySet()
void
int
size()
void
Set 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, wait
Methods 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:
updateTimestamp
in interfaceContainer
-
getTimestamp
public long getTimestamp()Returns the timestamp of this container.- Specified by:
getTimestamp
in 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:
keyIterator
in 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:
valueIterator
in interfaceContainer
- Returns:
- An iterator over the values currently contained in the container.
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<Object,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Object,
Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-