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>
public class PartitionedIterator<T> extends AbstractPartitionedIterator<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
Fields Modifier and Type Field Description protected boolean
m_fKeysOnly
Differentiates between a key iterator (true) and an entry iterator (false).static int
OPT_ENTRIES
An option to iterate Map Entry objects.static int
OPT_KEYS
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
Constructors Constructor Description PartitionedIterator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterable<T>
nextIterable(PartitionedFilter filter)
Obtain the next Iterable for a given filter.protected void
remove(Object oPrev)
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 Detail
-
OPT_KEYS
public static final int OPT_KEYS
An option to iterate the Map keys. This is the default.- See Also:
- Constant Field Values
-
OPT_ENTRIES
public static final int OPT_ENTRIES
An option to iterate Map Entry objects.- See Also:
- Constant Field Values
-
m_fKeysOnly
protected boolean m_fKeysOnly
Differentiates between a key iterator (true) and an entry iterator (false).
-
-
Constructor Detail
-
PartitionedIterator
public PartitionedIterator(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.- 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 Detail
-
nextIterable
protected Iterable<T> nextIterable(PartitionedFilter filter)
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
protected void remove(Object oPrev)
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
-
-