Class ReadOnlySegmentAwareIterator<E>

java.lang.Object
org.infinispan.distribution.util.ReadOnlySegmentAwareIterator<E>
All Implemented Interfaces:
Iterator<E>
Direct Known Subclasses:
ReadOnlySegmentAwareEntryIterator

public class ReadOnlySegmentAwareIterator<E> extends Object implements Iterator<E>
Iterator implementation that shows a read only view of the provided iterator by only allowing values that map to a given segment using the provided consistent hash.

This iterator is used with the other various SegmentAware Collections such as ReadOnlySegmentAwareCollection

Since:
7.2
Author:
wburns
  • Field Details

    • iter

      protected final Iterator<E> iter
    • topology

      protected final LocalizedCacheTopology topology
    • allowedSegments

      protected final org.infinispan.commons.util.IntSet allowedSegments
    • next

      protected E next
  • Constructor Details

    • ReadOnlySegmentAwareIterator

      public ReadOnlySegmentAwareIterator(Iterator<E> iter, LocalizedCacheTopology topology, org.infinispan.commons.util.IntSet allowedSegments)
  • Method Details

    • valueAllowed

      protected boolean valueAllowed(Object obj)
    • findNext

      protected E findNext()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<E>
    • next

      public E next()
      Specified by:
      next in interface Iterator<E>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<E>