Class ResultsetRowsStatic

java.lang.Object
com.mysql.cj.protocol.a.result.AbstractResultsetRows
com.mysql.cj.protocol.a.result.ResultsetRowsStatic
All Implemented Interfaces:
ProtocolEntity, ResultsetRows, RowList, java.util.Iterator<Row>

public class ResultsetRowsStatic
extends AbstractResultsetRows
implements ResultsetRows
Represents an in-memory result set
  • Constructor Details

  • Method Details

    • addRow

      public void addRow​(Row row)
      Description copied from interface: ResultsetRows
      Adds a row.
      Specified by:
      addRow in interface ResultsetRows
      Parameters:
      row - the row to add
    • afterLast

      public void afterLast()
      Description copied from interface: ResultsetRows
      Moves to after last.
      Specified by:
      afterLast in interface ResultsetRows
    • beforeFirst

      public void beforeFirst()
      Description copied from interface: ResultsetRows
      Moves to before first.
      Specified by:
      beforeFirst in interface ResultsetRows
    • beforeLast

      public void beforeLast()
      Description copied from interface: ResultsetRows
      Moves to before last.
      Specified by:
      beforeLast in interface ResultsetRows
    • get

      public Row get​(int atIndex)
      Description copied from interface: RowList
      Optionally retrieve Row at index n. Only works on non dynamic row lists.
      Specified by:
      get in interface RowList
      Parameters:
      atIndex - row number
      Returns:
      Row
    • getPosition

      public int getPosition()
      Description copied from interface: RowList
      Returns the current position.
      Specified by:
      getPosition in interface RowList
      Returns:
      the current row number
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<Row>
    • isAfterLast

      public boolean isAfterLast()
      Description copied from interface: ResultsetRows
      Returns true if we got the last element.
      Specified by:
      isAfterLast in interface ResultsetRows
      Returns:
      true if after last row
    • isBeforeFirst

      public boolean isBeforeFirst()
      Description copied from interface: ResultsetRows
      Returns if iteration has not occured yet.
      Specified by:
      isBeforeFirst in interface ResultsetRows
      Returns:
      true if before first row
    • isDynamic

      public boolean isDynamic()
      Description copied from interface: ResultsetRows
      Returns true if the result set is dynamic. This means that move back and move forward won't work because we do not hold on to the records.
      Specified by:
      isDynamic in interface ResultsetRows
      Returns:
      true if this result set is streaming from the server
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ResultsetRows
      Has no records.
      Specified by:
      isEmpty in interface ResultsetRows
      Returns:
      true if no records
    • isFirst

      public boolean isFirst()
      Description copied from interface: ResultsetRows
      Are we on the first row of the result set?
      Specified by:
      isFirst in interface ResultsetRows
      Returns:
      true if on first row
    • isLast

      public boolean isLast()
      Description copied from interface: ResultsetRows
      Are we on the last row of the result set?
      Specified by:
      isLast in interface ResultsetRows
      Returns:
      true if on last row
    • moveRowRelative

      public void moveRowRelative​(int rowsToMove)
      Description copied from interface: ResultsetRows
      Moves the current position relative 'rows' from the current position.
      Specified by:
      moveRowRelative in interface ResultsetRows
      Parameters:
      rowsToMove - the relative number of rows to move
    • next

      public Row next()
      Specified by:
      next in interface java.util.Iterator<Row>
    • remove

      public void remove()
      Specified by:
      remove in interface java.util.Iterator<Row>
    • setCurrentRow

      public void setCurrentRow​(int newIndex)
      Description copied from interface: ResultsetRows
      Moves the current position in the result set to the given row number.
      Specified by:
      setCurrentRow in interface ResultsetRows
      Parameters:
      newIndex - row to move to
    • size

      public int size()
      Description copied from interface: RowList
      Only works on non dynamic row lists.
      Specified by:
      size in interface RowList
      Returns:
      the size of this row list
    • wasEmpty

      public boolean wasEmpty()
      Description copied from interface: ResultsetRows
      Did this result set have no rows?
      Specified by:
      wasEmpty in interface ResultsetRows
      Overrides:
      wasEmpty in class AbstractResultsetRows
      Returns:
      true if the result set did not have rows