Class ResultSet

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Iterable<Result>

    public class ResultSet
    extends java.lang.Object
    implements java.lang.Iterable<Result>, java.lang.AutoCloseable
    A result set representing the query result. The result set is an iterator of the Result objects.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Result> allResults()
      Return List of Results.
      void close()  
      java.util.Iterator<Result> iterator()
      Return Iterator of Results.
      Result next()
      Move the cursor forward one row from its current row position.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • next

        @Nullable
        public Result next()
        Move the cursor forward one row from its current row position. Caution: next() method and iterator() method share same data structure. Please don't use them together. Caution: In case ResultSet is obtained from QueryChangeListener, and QueryChangeListener is already removed from Query, ResultSet is already freed. And this next() method returns null.
        Returns:
        the Result after moving the cursor forward. Returns null value if there are no more rows, or ResultSet is freed already.
      • allResults

        @NonNull
        public java.util.List<Result> allResults()
        Return List of Results. List is unmodifiable and only supports int get(int index), int size(), boolean isEmpty() and Iterator<Result> iterator() methods. Once called allResults(), next() method return null. Don't call next() and allResults() together.
        Returns:
        List of Results
      • iterator

        @NonNull
        public java.util.Iterator<Result> iterator()
        Return Iterator of Results. Once called iterator(), next() method return null. Don't call next() and iterator() together.
        Specified by:
        iterator in interface java.lang.Iterable<Result>
        Returns:
        an iterator over the elements in this list in proper sequence
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable