|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse
public final class ResultSetResponse
The ResultSetResponse object represents a subset of result records returned from a query to the data service.
Usage example:
ResultSetReponse results = ...;
for(ResultRecord record : results) {
System.out.print("Record: ");
for(ResultField value : record) {
System.out.print(value.getObject.toString());
System.out.print("; ");
}
System.out.println();
}
Nested Class Summary | |
---|---|
static class |
ResultSetResponse.ListSet
The ListSet class represents a list of lists and allows them to be iterated as a matrix of rows and columns. |
static class |
ResultSetResponse.ResultRecord
The ResultRecord class represents the fields of a single record. |
Constructor Summary | |
---|---|
ResultSetResponse()
|
|
ResultSetResponse(java.lang.String queryId,
boolean lastSet)
|
|
ResultSetResponse(java.lang.String queryId,
java.util.Map<java.lang.String,java.lang.String> columnInfo)
|
|
ResultSetResponse(java.lang.String queryId,
java.util.Map<java.lang.String,java.lang.String> columnInfo,
boolean lastSet)
|
Method Summary | |
---|---|
void |
addRecord(java.util.List<java.lang.Object> record)
Adds a record to the result set. |
boolean |
equals(java.lang.Object obj)
|
int |
fieldSize()
Returns the number of fields in each record of this result set. |
java.util.List<gov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse.InternalColumn> |
getColumnList()
Retrieves the internal representation for this result set. |
java.util.Date |
getDate(int recordIndex,
int fieldIndex)
Retrieves an Java Date representation of a field value for the supplied record index and field index. |
java.util.Date |
getDate(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Date representation of a field value for the supplied record index and field name. |
java.lang.Double |
getDouble(int recordIndex,
int fieldIndex)
Retrieves an Java Double representation of a field value for the supplied record index and field index. |
java.lang.Double |
getDouble(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Double representation of a field value for the supplied record index and field name. |
java.lang.String |
getFieldName(int fieldIndex)
Retrieves the field name for a supplied field index. |
java.util.Map<java.lang.String,java.lang.Integer> |
getFieldNameMap()
Retrieves the Map from field name to field index. |
java.lang.String |
getFieldType(int fieldIndex)
Retrieves the Java field type for a given field index. |
java.lang.String |
getFieldType(java.lang.String fieldName)
Retrieves the Java field type for a given field name. |
java.lang.Float |
getFloat(int recordIndex,
int fieldIndex)
Retrieves an Java Float representation of a field value for the supplied record index and field index. |
java.lang.Float |
getFloat(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Float representation of a field value for the supplied record index and field name. |
java.lang.Integer |
getInteger(int recordIndex,
int fieldIndex)
Retrieves an Java Integer representation of a field value for the supplied record index and field index. |
java.lang.Integer |
getInteger(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Integer representation of a field value for the supplied record index and field name. |
java.util.List<?> |
getList(int recordIndex,
int fieldIndex)
Retrieves an Java List representation of a field value for the supplied record index and field index. |
java.util.List<?> |
getList(int recordIndex,
java.lang.String fieldName)
Retrieves an Java List representation of a field value for the supplied record index and field name. |
java.lang.Long |
getLong(int recordIndex,
int fieldIndex)
Retrieves an Java Long representation of a field value for the supplied record index and field index. |
java.lang.Long |
getLong(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Long representation of a field value for the supplied record index and field name. |
java.lang.Object |
getObject(int recordIndex,
int fieldIndex)
Retrieves a Java Object representation of a field value for the supplied record index and field index. |
java.lang.Object |
getObject(int recordIndex,
java.lang.String fieldName)
Retrieves an Java Object representation of a field value for the supplied record index and field name. |
java.lang.String |
getQueryId()
Retrieve the unique query ID of the query that generated this result set. |
int |
getQueryProcessingTime()
Retrieves the time, in milliseconds, that it took to execute the query that generated these results. |
java.lang.String |
getString(int recordIndex,
int fieldIndex)
Retrieves a Java String representation of a field value for the supplied record index and field index. |
java.lang.String |
getString(int recordIndex,
java.lang.String fieldName)
Retrieves an Java String representation of a field value for the supplied record index and field name. |
long |
getTotalMatchingRecords()
Retrieves the total number of records that matched the executed query. |
int |
hashCode()
|
boolean |
isLastSet()
Returns true is this is the last set of results for a query. |
java.util.Iterator<ResultSetResponse.ResultRecord> |
iterator()
Returns an iterator over the result set records. |
int |
recordSize()
Returns the number of records in this result set |
void |
setColumnList(java.util.List<gov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse.InternalColumn> columnList)
Sets the internal representation for this result set. |
void |
setFieldNameMap(java.util.Map<java.lang.String,java.lang.Integer> columnNameMap)
Sets the Map for field name to field index. |
void |
setLastSet(boolean lastSet)
Set whether this is that last set of results for a query. |
void |
setQueryId(java.lang.String queryId)
Set the unique query ID. |
void |
setQueryProcessingTime(int queryProcessingTime)
Set the query processing time. |
void |
setTotalMatchingRecords(long totalMatchingRecords)
Set the total number of records that matched the executed query. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResultSetResponse()
public ResultSetResponse(java.lang.String queryId, boolean lastSet)
public ResultSetResponse(java.lang.String queryId, java.util.Map<java.lang.String,java.lang.String> columnInfo)
public ResultSetResponse(java.lang.String queryId, java.util.Map<java.lang.String,java.lang.String> columnInfo, boolean lastSet)
Method Detail |
---|
public void addRecord(java.util.List<java.lang.Object> record) throws java.lang.IndexOutOfBoundsException
record
- the data set record to add
java.lang.IndexOutOfBoundsException
public int recordSize()
public int fieldSize()
public java.util.Iterator<ResultSetResponse.ResultRecord> iterator()
iterator
in interface java.lang.Iterable<ResultSetResponse.ResultRecord>
Iterable.iterator()
public java.lang.String getFieldName(int fieldIndex) throws java.lang.IndexOutOfBoundsException
fieldIndex
- the field index
java.lang.IndexOutOfBoundsException
public java.lang.String getFieldType(int fieldIndex) throws java.lang.IndexOutOfBoundsException
fieldIndex
- the field index
java.lang.IndexOutOfBoundsException
public java.lang.String getFieldType(java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
fieldName
- the field name
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
public java.lang.Object getObject(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldIndex
- the field index
java.lang.IndexOutOfBoundsException
public java.lang.Object getObject(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
public java.lang.String getString(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldIndex
- the field index
java.lang.IndexOutOfBoundsException
public java.lang.String getString(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
public java.lang.Integer getInteger(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException, java.lang.NumberFormatException
recordIndex
- the record indexfieldIndex
- the field name
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException
public java.lang.Integer getInteger(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public java.lang.Long getLong(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException, java.lang.NumberFormatException
recordIndex
- the record indexfieldIndex
- the field name
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public java.lang.Long getLong(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public java.lang.Float getFloat(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException, java.lang.NumberFormatException
recordIndex
- the record indexfieldIndex
- the field name
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException
public java.lang.Float getFloat(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public java.lang.Double getDouble(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException, java.lang.NumberFormatException
recordIndex
- the record indexfieldIndex
- the field index
java.lang.IndexOutOfBoundsException
java.lang.NumberFormatException
public java.lang.Double getDouble(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IndexOutOfBoundsException
public java.util.Date getDate(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException, java.text.ParseException
recordIndex
- the record indexfieldIndex
- the field index
java.lang.IndexOutOfBoundsException
java.text.ParseException
public java.util.Date getDate(int recordIndex, java.lang.String fieldName) throws java.lang.IllegalArgumentException, java.text.ParseException, java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldName
- the field name
java.lang.IllegalArgumentException
java.text.ParseException
java.lang.IndexOutOfBoundsException
public java.util.List<?> getList(int recordIndex, int fieldIndex) throws java.lang.IndexOutOfBoundsException
recordIndex
- the record indexfieldIndex
- the field index
java.lang.IndexOutOfBoundsException
public java.util.List<?> getList(int recordIndex, java.lang.String fieldName) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
recordIndex
- the record indexfieldName
- the field name
java.lang.IndexOutOfBoundsException
java.lang.IllegalArgumentException
public java.lang.String getQueryId()
public void setQueryId(java.lang.String queryId)
queryId
- the unique query IDpublic int getQueryProcessingTime()
public void setQueryProcessingTime(int queryProcessingTime)
queryProcessingTime
- the query processing time in milliseconds.public long getTotalMatchingRecords()
public void setTotalMatchingRecords(long totalMatchingRecords)
totalMatchingRecords
- the total number of matching recordspublic boolean isLastSet()
public void setLastSet(boolean lastSet)
lastSet
- true if this is the last set, false otherwisepublic java.util.List<gov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse.InternalColumn> getColumnList()
public void setColumnList(java.util.List<gov.ornl.csed.csiir.idr.kdd.dataservice.server.models.ResultSetResponse.InternalColumn> columnList)
columnList
- the list of columnspublic java.util.Map<java.lang.String,java.lang.Integer> getFieldNameMap()
public void setFieldNameMap(java.util.Map<java.lang.String,java.lang.Integer> columnNameMap)
columnNameMap
- the map of field name to field indexpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |