Class RowResultSet


  • public class RowResultSet
    extends ResultSet
    A class for managing results received as a jsonrows result-set. This class contains logic for parsing data in this format into meaningful data-structures, and handling errors.
    • Constructor Summary

      Constructors 
      Constructor Description
      RowResultSet​(java.io.BufferedReader reader, java.util.List<java.lang.String> views, int version)
      Constructor with a reader.
      RowResultSet​(java.lang.String stringResults, java.util.List<java.lang.String> views)
      Construct a new result-set from a string and a list of output columns.
      RowResultSet​(HttpConnection connection, java.util.List<java.lang.String> views, int version)
      Construct a new result-set with an HttpConnection and a list of output columns.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.util.List<java.lang.String>> getData()  
      java.util.Iterator<java.util.List<java.lang.Object>> getListIterator()
      Get a memory efficient iterator over the result rows as lists
      java.util.Iterator<java.util.Map<java.lang.String,​java.lang.Object>> getMapIterator()
      Get a memory efficient iterator over the result rows as lists
      java.util.List<java.util.List<java.lang.Object>> getRowsAsLists()
      Get the data for this result set in a parsed form.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getRowsAsMaps()
      Get the data for this result set in a parsed form.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RowResultSet

        public RowResultSet​(HttpConnection connection,
                            java.util.List<java.lang.String> views,
                            int version)
        Construct a new result-set with an HttpConnection and a list of output columns.
        Parameters:
        connection - The connection to receive results from.
        views - The columns selected for output.
        version - The web service version of the service these results come from.
      • RowResultSet

        public RowResultSet​(java.io.BufferedReader reader,
                            java.util.List<java.lang.String> views,
                            int version)
        Constructor with a reader. Use this constructor when you want to make the request yourself.
        Parameters:
        reader - A presupplied reader, presumably obtained by opening a URL or a file.
        views - The columns selected for output.
        version - The web service version of the service these results come from.
      • RowResultSet

        public RowResultSet​(java.lang.String stringResults,
                            java.util.List<java.lang.String> views)
        Construct a new result-set from a string and a list of output columns. This constructor is primarily used in testing.
        Parameters:
        stringResults - The results as a single string.
        views - The columns selected for output.
    • Method Detail

      • getData

        public java.util.List<java.util.List<java.lang.String>> getData()
      • getRowsAsLists

        public java.util.List<java.util.List<java.lang.Object>> getRowsAsLists()
        Get the data for this result set in a parsed form. In this format, each row is parsed into a suitable object type. The types of this data should match that of the data-types of the attributes selected for output. You will need to cast these objects to a suitable type before use.
        Returns:
        A two-dimensional list (tables) of objects.
      • getRowsAsMaps

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getRowsAsMaps()
        Get the data for this result set in a parsed form. In this format, each row is parsed into a suitable object type. The types of this data should match that of the data-types of the attributes selected for output. You will need to cast these objects to a suitable type before use.
        Returns:
        A list of rows, where each row is a map from column name to value.
      • getListIterator

        public java.util.Iterator<java.util.List<java.lang.Object>> getListIterator()
        Get a memory efficient iterator over the result rows as lists
        Returns:
        an iterator over the rows in this result set as lists of values
      • getMapIterator

        public java.util.Iterator<java.util.Map<java.lang.String,​java.lang.Object>> getMapIterator()
        Get a memory efficient iterator over the result rows as lists
        Returns:
        an iterator over the rows in this result set as maps of column names to values