gov.ornl.csed.csiir.idr.kdd.dataservice.server.models
Class ResultSetResponse.ListSet

java.lang.Object
  extended by gov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse.ListSet
All Implemented Interfaces:
java.lang.Iterable<ListSetRow>
Enclosing class:
ResultSetResponse

public static class ResultSetResponse.ListSet
extends java.lang.Object
implements java.lang.Iterable<ListSetRow>

The ListSet class represents a list of lists and allows them to be iterated as a matrix of rows and columns. Each inner list is treated as a column and a row contains the value from each column with the same index. If the supplied column lists are different lengths, all missing values are returned as null.


Nested Class Summary
static class ResultSetResponse.ListSet.ListSetCell
           
static class ResultSetResponse.ListSet.ListSetRow
          The ListSetRow class represents a row in the ListSet and allows iteration over the cell values in the row.
 
Method Summary
 int columnSize()
          Retrieves the number of columns.
 java.util.Date getDate(int rowIndex, int columnIndex)
          Retrieves the Java Date representation of the cell value at the given row index and column index.
 java.lang.Double getDouble(int rowIndex, int columnIndex)
          Retrieves the Java Double representation of the cell value at the given row index and column index.
 java.lang.Float getFloat(int rowIndex, int columnIndex)
          Retrieves the Java Float representation of the cell value at the given row index and column index.
 java.lang.Integer getInteger(int rowIndex, int columnIndex)
          Retrieves the Java Integer representation of the cell value at the given row index and column index.
 java.lang.Long getLong(int rowIndex, int columnIndex)
          Retrieves the Java Long representation of the cell value at the given row index and column index.
 java.lang.Object getObject(int rowIndex, int columnIndex)
          Retrieves the Java Object representation of the value at the given row index and column index.
 java.lang.String getString(int rowIndex, int columnIndex)
          Retrieves the Java String representation of the cell value at the given row index and column index.
 java.util.Iterator<ResultSetResponse.ListSet.ListSetRow> iterator()
          Retrieve an iterator over the rows.
 int rowSize()
          Retrieves the number of rows.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

columnSize

public int columnSize()
Retrieves the number of columns. Equivalent to the number of lists provided to the constructor.

Returns:
the number of columns

rowSize

public int rowSize()
Retrieves the number of rows. Equivalent to the length of the longest list provided to the constructor.

Returns:
the number of rows

getObject

public java.lang.Object getObject(int rowIndex,
                                  int columnIndex)
                           throws java.lang.IndexOutOfBoundsException
Retrieves the Java Object representation of the value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Object representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException

getString

public java.lang.String getString(int rowIndex,
                                  int columnIndex)
                           throws java.lang.IndexOutOfBoundsException
Retrieves the Java String representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java String representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException

getInteger

public java.lang.Integer getInteger(int rowIndex,
                                    int columnIndex)
                             throws java.lang.IndexOutOfBoundsException,
                                    java.lang.NumberFormatException
Retrieves the Java Integer representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Integer representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException

getLong

public java.lang.Long getLong(int rowIndex,
                              int columnIndex)
                       throws java.lang.IndexOutOfBoundsException,
                              java.lang.NumberFormatException
Retrieves the Java Long representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Long representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException

getFloat

public java.lang.Float getFloat(int rowIndex,
                                int columnIndex)
                         throws java.lang.IndexOutOfBoundsException,
                                java.lang.NumberFormatException
Retrieves the Java Float representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Float representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException

getDouble

public java.lang.Double getDouble(int rowIndex,
                                  int columnIndex)
                           throws java.lang.IndexOutOfBoundsException,
                                  java.lang.NumberFormatException
Retrieves the Java Double representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Double representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException

getDate

public java.util.Date getDate(int rowIndex,
                              int columnIndex)
                       throws java.lang.IndexOutOfBoundsException,
                              java.text.ParseException
Retrieves the Java Date representation of the cell value at the given row index and column index.

Parameters:
rowIndex - the row index
columnIndex - the column index
Returns:
the Java Date representation of the cell value
Throws:
java.lang.IndexOutOfBoundsException
java.text.ParseException

iterator

public java.util.Iterator<ResultSetResponse.ListSet.ListSetRow> iterator()
Retrieve an iterator over the rows.

Specified by:
iterator in interface java.lang.Iterable<ListSetRow>
See Also:
Iterable.iterator()