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
FieldsModifier and TypeFieldDescriptionprotected booleanDifferentiates between a key iterator (true) and an entry iterator (false).static final intAn option to iterate Map Entry objects.static final intAn 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
ConstructorsConstructorDescriptionPartitionedIterator(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 voidRemove the specified item.Methods inherited from class com.tangosol.net.partition.AbstractPartitionedIterator
advanceMethods inherited from class com.oracle.coherence.common.collections.AbstractStableIterator
getPrevious, hasMoreElements, hasNext, next, nextElement, remove, setNextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIteratorMethods 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:AbstractPartitionedIteratorObtain the next Iterable for a given filter. This method is called when the Iterable returned by the previous call is exhausted.- Specified by:
nextIterablein 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.AbstractStableIteratorRemove 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:
removein classAbstractPartitionedIterator<T>- Parameters:
oPrev- the previously iterated object that should be removed
-