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

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

public static class ResultSetResponse.ResultRecord
extends java.lang.Object
implements java.lang.Iterable<ResultField>

The ResultRecord class represents the fields of a single record. It is iterable for each result field.


Nested Class Summary
static class ResultSetResponse.ResultRecord.ResultField
          The ResultField class represents a field value.
 
Method Summary
 java.util.Date getDate(int fieldIndex)
          Retrieve a Java Date representation for a field value given the supplied field index.
 java.util.Date getDate(java.lang.String fieldName)
          Retrieve a Java Date representation for a field value given the supplied field name.
 java.lang.Double getDouble(int fieldIndex)
          Retrieve a Java Double representation for a field value given the supplied field index.
 java.lang.Double getDouble(java.lang.String fieldName)
          Retrieve a Java Double representation for a field value given the supplied field name.
 java.lang.String getFieldName(int fieldIndex)
          Retrieve the field name for a supplied field index.
 java.lang.String getFieldType(int fieldIndex)
          Retrieve the field type for a supplied field index.
 java.lang.String getFieldType(java.lang.String fieldName)
          Retrieve the field type for a supplied field name.
 java.lang.Float getFloat(int fieldIndex)
          Retrieve a Java Float representation for a field value given the supplied field index.
 java.lang.Float getFloat(java.lang.String fieldName)
          Retrieve a Java Float representation for a field value given the supplied field name.
 java.lang.Integer getInteger(int fieldIndex)
          Retrieve a Java Integer representation for a field value given the supplied field index.
 java.lang.Integer getInteger(java.lang.String fieldName)
          Retrieve a Java Integer representation for a field value given the supplied field name.
 java.util.List<?> getList(int fieldIndex)
          Retrieve a Java List representation for a field value given the supplied field index.
 java.util.List<?> getList(java.lang.String fieldName)
          Retrieve a Java List representation for a field value given the supplied field name.
 java.lang.Long getLong(int fieldIndex)
          Retrieve a Java Long representation for a field value given the supplied field index.
 java.lang.Long getLong(java.lang.String fieldName)
          Retrieve a Java Long representation for a field value given the supplied field name.
 java.lang.Object getObject(int fieldIndex)
          Retrieve a Java Object representation for a field value given the supplied field index.
 java.lang.Object getObject(java.lang.String fieldName)
          Retrieve a Java Object representation for a field value given the supplied field name.
 java.lang.String getString(int fieldIndex)
          Retrieve a Java String representation for a field value given the supplied field index.
 java.lang.String getString(java.lang.String fieldName)
          Retrieve a Java String representation for a field value given the supplied field name.
 java.util.Iterator<ResultSetResponse.ResultRecord.ResultField> iterator()
          Retrieve an iterator over the field values.
 ResultSetResponse.ListSet listSet(int... fieldIndexes)
          Retrieves a ListSet for a supplied list of field indexes which must all represent fields of type List.
 ResultSetResponse.ListSet listSet(java.lang.String... fieldNames)
          Retrieves a ListSet for a supplied list of field names which must all represent fields of type List.
 int size()
          Retrieve the number of fields in this record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFieldName

public java.lang.String getFieldName(int fieldIndex)
                              throws java.lang.IndexOutOfBoundsException
Retrieve the field name for a supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the field name
Throws:
java.lang.IndexOutOfBoundsException

getFieldType

public java.lang.String getFieldType(int fieldIndex)
                              throws java.lang.IndexOutOfBoundsException
Retrieve the field type for a supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the field type
Throws:
java.lang.IndexOutOfBoundsException

getFieldType

public java.lang.String getFieldType(java.lang.String fieldName)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.IndexOutOfBoundsException
Retrieve the field type for a supplied field name.

Parameters:
fieldName - the field name
Returns:
the field type
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException

getObject

public java.lang.Object getObject(int fieldIndex)
                           throws java.lang.IndexOutOfBoundsException
Retrieve a Java Object representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the object
Throws:
java.lang.IndexOutOfBoundsException

getObject

public java.lang.Object getObject(java.lang.String fieldName)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.IndexOutOfBoundsException
Retrieve a Java Object representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the object
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException

getString

public java.lang.String getString(int fieldIndex)
                           throws java.lang.IndexOutOfBoundsException
Retrieve a Java String representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the string
Throws:
java.lang.IndexOutOfBoundsException

getString

public java.lang.String getString(java.lang.String fieldName)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.IndexOutOfBoundsException
Retrieve a Java String representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the string
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException

getInteger

public java.lang.Integer getInteger(int fieldIndex)
                             throws java.lang.NumberFormatException,
                                    java.lang.IndexOutOfBoundsException
Retrieve a Java Integer representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the integer
Throws:
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getInteger

public java.lang.Integer getInteger(java.lang.String fieldName)
                             throws java.lang.IllegalArgumentException,
                                    java.lang.NumberFormatException,
                                    java.lang.IndexOutOfBoundsException
Retrieve a Java Integer representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the integer
Throws:
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getLong

public java.lang.Long getLong(int fieldIndex)
                       throws java.lang.NumberFormatException,
                              java.lang.IndexOutOfBoundsException
Retrieve a Java Long representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the long
Throws:
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getLong

public java.lang.Long getLong(java.lang.String fieldName)
                       throws java.lang.IllegalArgumentException,
                              java.lang.NumberFormatException,
                              java.lang.IndexOutOfBoundsException
Retrieve a Java Long representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the long
Throws:
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getFloat

public java.lang.Float getFloat(int fieldIndex)
                         throws java.lang.NumberFormatException,
                                java.lang.IndexOutOfBoundsException
Retrieve a Java Float representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
float
Throws:
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getFloat

public java.lang.Float getFloat(java.lang.String fieldName)
                         throws java.lang.IllegalArgumentException,
                                java.lang.NumberFormatException,
                                java.lang.IndexOutOfBoundsException
Retrieve a Java Float representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the float
Throws:
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getDouble

public java.lang.Double getDouble(int fieldIndex)
                           throws java.lang.NumberFormatException,
                                  java.lang.IndexOutOfBoundsException
Retrieve a Java Double representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the double
Throws:
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getDouble

public java.lang.Double getDouble(java.lang.String fieldName)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NumberFormatException,
                                  java.lang.IndexOutOfBoundsException
Retrieve a Java Double representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the double
Throws:
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException

getDate

public java.util.Date getDate(int fieldIndex)
                       throws java.text.ParseException,
                              java.lang.IndexOutOfBoundsException
Retrieve a Java Date representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the date
Throws:
java.text.ParseException
java.lang.IndexOutOfBoundsException

getDate

public java.util.Date getDate(java.lang.String fieldName)
                       throws java.lang.IllegalArgumentException,
                              java.text.ParseException,
                              java.lang.IndexOutOfBoundsException
Retrieve a Java Date representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the date
Throws:
java.lang.IllegalArgumentException
java.text.ParseException
java.lang.IndexOutOfBoundsException

getList

public java.util.List<?> getList(int fieldIndex)
                          throws java.lang.IndexOutOfBoundsException
Retrieve a Java List representation for a field value given the supplied field index.

Parameters:
fieldIndex - the field index
Returns:
the list
Throws:
java.lang.IndexOutOfBoundsException

getList

public java.util.List<?> getList(java.lang.String fieldName)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.IndexOutOfBoundsException
Retrieve a Java List representation for a field value given the supplied field name.

Parameters:
fieldName - the field name
Returns:
the list
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException

size

public int size()
Retrieve the number of fields in this record.

Returns:
the number of fields

iterator

public java.util.Iterator<ResultSetResponse.ResultRecord.ResultField> iterator()
Retrieve an iterator over the field values.

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

listSet

public ResultSetResponse.ListSet listSet(int... fieldIndexes)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.IndexOutOfBoundsException
Retrieves a ListSet for a supplied list of field indexes which must all represent fields of type List. The resulting ListSet allows the underlying fields to be iterated over as rows.

Parameters:
fieldIndexes - the list of field indexes
Returns:
a ListSet for the provided fields
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException

listSet

public ResultSetResponse.ListSet listSet(java.lang.String... fieldNames)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.IndexOutOfBoundsException
Retrieves a ListSet for a supplied list of field names which must all represent fields of type List. The resulting ListSet allows the underlying fields to be iterated over as rows.

Parameters:
fieldNames - the list of field names
Returns:
a ListSet for the provided fields
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException