public class BufferedQueryResult extends Object implements BufferedQueryResultIF
Modifier and Type | Field and Description |
---|---|
protected Collection |
buffer |
protected Object[] |
bufferedRow |
protected Iterator |
bufferIt |
protected boolean |
inBuffer |
protected String |
query |
protected QueryResultIF |
queryResult |
Constructor and Description |
---|
BufferedQueryResult(QueryResultIF queryResult,
String query) |
Modifier and Type | Method and Description |
---|---|
void |
close()
PUBLIC: Closes the query result, which allows it to free its
resources.
|
String |
getColumnName(int ix)
PUBLIC: Returns the name of the given column.
|
String[] |
getColumnNames()
PUBLIC: Returns the names of the columns.
|
int |
getIndex(String colname)
PUBLIC: Returns the index of the named column.
|
String |
getQuery()
Get the query of the query result.
|
Object |
getValue(int ix)
PUBLIC: Returns the value in the given column in the current
match.
|
Object |
getValue(String colname)
PUBLIC: Returns the value in the given column in the current
match.
|
Object[] |
getValues()
PUBLIC: Returns the current match as an array of values.
|
Object[] |
getValues(Object[] values)
PUBLIC: Reads the values of the current match into the specified
array.
|
int |
getWidth()
PUBLIC: Returns the number of columns in the result.
|
boolean |
next()
PUBLIC: Steps to the next match, returning true if a valid match
was found, and false if there are no more matches.
|
void |
restart()
Bring this BufferedQueryResultIF back to the initial state after
it was created (instantiated to an implementing class).
|
protected QueryResultIF queryResult
protected Collection buffer
protected Object[] bufferedRow
protected Iterator bufferIt
protected boolean inBuffer
protected String query
public BufferedQueryResult(QueryResultIF queryResult, String query)
public void close()
QueryResultIF
close
in interface AutoCloseable
close
in interface QueryResultIF
public String getColumnName(int ix)
QueryResultIF
getColumnName
in interface QueryResultIF
public String[] getColumnNames()
QueryResultIF
getColumnNames
in interface QueryResultIF
public int getIndex(String colname)
QueryResultIF
getIndex
in interface QueryResultIF
public Object getValue(int ix)
QueryResultIF
next()
to have been called first.getValue
in interface QueryResultIF
public Object getValue(String colname)
QueryResultIF
next()
to have been called first.getValue
in interface QueryResultIF
public Object[] getValues()
QueryResultIF
next()
to have been
called first.getValues
in interface QueryResultIF
public Object[] getValues(Object[] values)
QueryResultIF
next()
to have been called first.getValues
in interface QueryResultIF
public int getWidth()
QueryResultIF
getWidth
in interface QueryResultIF
public boolean next()
QueryResultIF
next
in interface QueryResultIF
public String getQuery()
BufferedQueryResultIF
getQuery
in interface BufferedQueryResultIF
public void restart()
BufferedQueryResultIF
restart
in interface BufferedQueryResultIF