Package com.tangosol.net.partition
Class PartitionedIterator<T>
java.lang.Object
com.oracle.coherence.common.collections.AbstractStableIterator<T>
com.tangosol.net.partition.AbstractPartitionedIterator<T>
com.tangosol.net.partition.PartitionedIterator<T>
- All Implemented Interfaces:
Enumeration<T>
,Iterator<T>
An Iterator that iterates over keys in a partition-by-partition or
member-by-member manner.
- Since:
- Coherence 3.5
- Author:
- cp 2009.04.07
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Differentiates between a key iterator (true) and an entry iterator (false).static final int
An option to iterate Map Entry objects.static final int
An option to iterate the Map keys.Fields inherited from class com.tangosol.net.partition.AbstractPartitionedIterator
m_cache, m_fByMember, m_filter, m_fRandom, m_setPids, OPT_BY_MEMBER, OPT_BY_PARTITION, OPT_RANDOMIZED
-
Constructor Summary
ConstructorDescriptionPartitionedIterator
(NamedCache cache, Filter filter, PartitionSet setPids, int nOptions) Construct PartitionedIterator that will provide iteration of the keys of the specified cache using the specified filter, but will only query one partition or one member at a time. -
Method Summary
Modifier and TypeMethodDescriptionnextIterable
(PartitionedFilter filter) Obtain the next Iterable for a given filter.protected void
Remove the specified item.Methods inherited from class com.tangosol.net.partition.AbstractPartitionedIterator
advance
Methods inherited from class com.oracle.coherence.common.collections.AbstractStableIterator
getPrevious, hasMoreElements, hasNext, next, nextElement, remove, setNext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Enumeration
asIterator
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
OPT_KEYS
public static final int OPT_KEYSAn option to iterate the Map keys. This is the default.- See Also:
-
OPT_ENTRIES
public static final int OPT_ENTRIESAn option to iterate Map Entry objects.- See Also:
-
m_fKeysOnly
protected boolean m_fKeysOnlyDifferentiates between a key iterator (true) and an entry iterator (false).
-
-
Constructor Details
-
PartitionedIterator
Construct PartitionedIterator that will provide iteration of the keys of the specified cache using the specified filter, but will only query one partition or one member at a time.- Parameters:
cache
- the cache to queryfilter
- the query expressed as a FiltersetPids
- the partitions to execute the query againstnOptions
- pass a bit-or'd combination of any of the OPT_* constants
-
-
Method Details
-
nextIterable
Description copied from class:AbstractPartitionedIterator
Obtain the next Iterable for a given filter. This method is called when the Iterable returned by the previous call is exhausted.- Specified by:
nextIterable
in classAbstractPartitionedIterator<T>
- Parameters:
filter
- filter to use- Returns:
- a next Iterable or null if there is no more data to iterate
-
remove
Description copied from class:com.oracle.coherence.common.collections.AbstractStableIterator
Remove the specified item.This is an optional operation. If the Iterator supports element removal, then it should implement this method, which is delegated to by the
AbstractStableIterator.remove()
method.- Overrides:
remove
in classAbstractPartitionedIterator<T>
- Parameters:
oPrev
- the previously iterated object that should be removed
-