Package ghidra.program.database.util

# Class QueryRecordIterator

java.lang.Object
ghidra.program.database.util.QueryRecordIterator

All Implemented Interfaces:
  `RecordIterator`

public class QueryRecordIterator extends Object implements RecordIterator
Iterator that only returns records from another iterator that match the given query.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `QueryRecordIterator(RecordIterator iter, Query query)`
  Constructs a new QueryRecordIterator that filters the given record iterator with the given Query.
  `QueryRecordIterator(RecordIterator iter, Query query, boolean forward)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `delete()`
  Delete the last Record read via the next or previous methods.
  `boolean`
  `hasNext()`
  Return true if a Record is available in the forward direction.
  `boolean`
  `hasPrevious()`
  Return true if a Record is available in the reverse direction
  `DBRecord`
  `next()`
  Return the next Record or null if one is not available.
  `DBRecord`
  `previous()`
  Return the previous Record or null if one is not available.

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

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

- ## Constructor Details

  - ### QueryRecordIterator

    public QueryRecordIterator(RecordIterator iter, Query query)
    Constructs a new QueryRecordIterator that filters the given record iterator with the given Query.
    Parameters:
      `iter` - the record iterator to filter.
      `query` - the query used to filter.

  - ### QueryRecordIterator

    public QueryRecordIterator(RecordIterator iter, Query query, boolean forward)
    Constructor
    Parameters:
      `iter` - record iterator
      `query` - query needed to match the record
      `forward` - true means iterate in the forward direction

- ## Method Details

  - ### hasNext

    public boolean hasNext() throws IOException
    Description copied from interface: `RecordIterator`
    Return true if a Record is available in the forward direction.
    Specified by:
      `hasNext` in interface `RecordIterator`
    Throws:
      `IOException` - thrown if an IO error occurs
    See Also:
      - `RecordIterator.hasNext()`

  - ### next

    public DBRecord next() throws IOException
    Description copied from interface: `RecordIterator`
    Return the next Record or null if one is not available.
    Specified by:
      `next` in interface `RecordIterator`
    Throws:
      `IOException` - thrown if an IO error occurs
    See Also:
      - `RecordIterator.next()`

  - ### hasPrevious

    public boolean hasPrevious() throws IOException
    Description copied from interface: `RecordIterator`
    Return true if a Record is available in the reverse direction
    Specified by:
      `hasPrevious` in interface `RecordIterator`
    Throws:
      `IOException` - thrown if an IO error occurs
    See Also:
      - `RecordIterator.hasPrevious()`

  - ### previous

    public DBRecord previous() throws IOException
    Description copied from interface: `RecordIterator`
    Return the previous Record or null if one is not available.
    Specified by:
      `previous` in interface `RecordIterator`
    Throws:
      `IOException` - thrown if an IO error occurs
    See Also:
      - `RecordIterator.previous()`

  - ### delete

    public boolean delete() throws IOException
    Description copied from interface: `RecordIterator`
    Delete the last Record read via the next or previous methods.
    Specified by:
      `delete` in interface `RecordIterator`
    Returns:
      true if record was successfully deleted.
    Throws:
      `IOException` - thrown if an IO error occurs.
    See Also:
      - `RecordIterator.delete()`