org.eclipse.rdf4j.model.util

## Class PatternIterator<S extends Statement>

- java.lang.Object
- - org.eclipse.rdf4j.model.util.PatternIterator<S>

- All Implemented Interfaces:
    Iterator<S>

      public class PatternIterator<S extends Statement>
      extends Object
      implements Iterator<S>

  Excludes an Iterator based on a given basic graph pattern.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PatternIterator(Iterator<S> iter, Value subj, Value pred, Value obj, Value... contexts)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `accept(S st)` Tests whether or not the specified statement should be returned by this iterator.
    `boolean` | `hasNext()`
    `S` | `next()`
    `void` | `remove()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### PatternIterator

          public PatternIterator(Iterator<S> iter,
                                 Value subj,
                                 Value pred,
                                 Value obj,
                                 Value... contexts)

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<S extends Statement>`

    - #### next

          public S next()

      Specified by:
        `next` in interface `Iterator<S extends Statement>`

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `Iterator<S extends Statement>`

    - #### accept

          protected boolean accept(S st)

      Tests whether or not the specified statement should be returned by this iterator. All objects from the wrapped iterator pass through this method in the same order as they are coming from the wrapped iterator.
      Parameters:
        `st` - The statement to be tested.
      Returns:
        `true` if the object should be returned, `false` otherwise.

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.