Class AbstractResultSet

java.lang.Object
cz.cvut.kbss.ontodriver.jena.query.AbstractResultSet
All Implemented Interfaces:
ResultSet, AutoCloseable, Iterable<ResultRow>
Direct Known Subclasses:
AskResultSet, SelectResultSet

public abstract class AbstractResultSet extends Object implements ResultSet
  • Constructor Details

    • AbstractResultSet

      public AbstractResultSet()
  • Method Details

    • getStatement

      public Statement getStatement()
      Description copied from interface: ResultSet
      Retrieves the Statement that produced this ResultSet object. If this result set was generated some other way, this method will return null.
      Specified by:
      getStatement in interface ResultSet
      Returns:
      The Statement that produced this ResultSet or null
    • isFirst

      public boolean isFirst()
      Description copied from interface: ResultSet
      Returns true if the cursor is at the first row of this result set.
      Specified by:
      isFirst in interface ResultSet
      Returns:
      True if the cursor is at the first row, false otherwise
    • last

      public void last()
      Description copied from interface: ResultSet
      Move the cursor to the last row in this results set.

      Note that since the result set may be asynchronously updated, the last row does not have to always be the same.

      Specified by:
      last in interface ResultSet
    • first

      public void first()
      Description copied from interface: ResultSet
      Move the cursor to the first row.
      Specified by:
      first in interface ResultSet
    • hasNext

      public boolean hasNext()
      Description copied from interface: ResultSet
      Returns true if the cursor does not point at the last row in this result set.
      Specified by:
      hasNext in interface ResultSet
      Returns:
      True if there is at least one next row
    • next

      public void next()
      Description copied from interface: ResultSet
      Move the cursor one row forward.
      Specified by:
      next in interface ResultSet
    • previous

      public void previous()
      Description copied from interface: ResultSet
      Move the cursor one row backwards.
      Specified by:
      previous in interface ResultSet
    • relative

      public void relative(int rows)
      Description copied from interface: ResultSet
      Move the cursor a relative number of rows, either positive or negative.
      Specified by:
      relative in interface ResultSet
      Parameters:
      rows - The number of rows to move the cursor of
    • getRowIndex

      public int getRowIndex()
      Description copied from interface: ResultSet
      Retrieves index of the current row.

      The first row has index 0.

      Specified by:
      getRowIndex in interface ResultSet
      Returns:
      the current row index, -1 if there is no current row
    • setRowIndex

      public void setRowIndex(int newIndex)
      Description copied from interface: ResultSet
      Move the cursor to the specified row index.

      The first row has index 0.

      Specified by:
      setRowIndex in interface ResultSet
      Parameters:
      newIndex - Index to move the cursor to
    • close

      public void close() throws JenaDriverException
      Description copied from interface: ResultSet
      Closes this result set releasing any sub-resources it holds.

      After closing the result set is not usable any more and calling methods on it (except close and isOpen) will result in OntoDriverException.

      Calling close on already closed resource does nothing.

      Calling this method also results in immediate disconnection of all registered observers and cancellation of any running reasoning associated with this result set.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ResultSet
      Throws:
      JenaDriverException
    • isOpen

      public boolean isOpen()
      Description copied from interface: ResultSet
      Retrieves status of this result set.
      Specified by:
      isOpen in interface ResultSet
      Returns:
      true if the resource is open, false otherwise