Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.net.partition
Class PartitionedIterator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.AbstractStableIterator
          extended by com.tangosol.net.partition.PartitionedIterator

All Implemented Interfaces:
java.util.Iterator

public class PartitionedIterator
extends AbstractStableIterator

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
static int OPT_BY_MEMBER
          An option to iterate one member at a time.
static int OPT_BY_PARTITION
          An option to iterate one partition at a time.
static int OPT_ENTRIES
          An option to iterate Map Entry objects.
static int OPT_KEYS
          An option to iterate the Map keys.
static int OPT_RANDOMIZED
          An option to iterate the members or partitions in a randomized order.

 

Constructor Summary
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
protected  void advance()
          Advance to the next object.
protected  void remove(java.lang.Object oPrev)
          Remove the specified item.

 

Methods inherited from class com.tangosol.util.AbstractStableIterator
getPrevious, hasNext, next, remove, setNext

 

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

OPT_BY_PARTITION

public static final int OPT_BY_PARTITION
An option to iterate one partition at a time. This is the default.
See Also:
Constant Field Values

OPT_BY_MEMBER

public static final int OPT_BY_MEMBER
An option to iterate one member at a time.
See Also:
Constant Field Values

OPT_RANDOMIZED

public static final int OPT_RANDOMIZED
An option to iterate the members or partitions in a randomized order. Note that this does not refer to the order that the individual keys or entries themselves will be iterated.
See Also:
Constant Field Values

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 query
filter - the query expressed as a Filter
setPids - the partitions to execute the query against
nOptions - pass a bit-or'd combination of any of the OPT_* constants

Method Detail

advance

protected void advance()
Advance to the next object.

This method must be implemented by the concrete sub-class by calling AbstractStableIterator.setNext(java.lang.Object) if there is a next object.

Specified by:
advance in class AbstractStableIterator

remove

protected void remove(java.lang.Object oPrev)
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 class AbstractStableIterator
Parameters:
oPrev - the previously iterated object that should be removed

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.