class SimpleResults extends java.lang.Object implements Results
Results
which stores row data in a list provided to the
constructor. The row data consists of a list of array objects. Each object in the array is
either a Record
object (a DMO instance) or a Long
which
represents a DMO's primary key ID. Note that this implementation may have a heavy memory
requirement for large results sets, especially if the entire DMO is stored and not just its
primary key ID.Modifier and Type | Field and Description |
---|---|
private int |
position
Index of current position in results list; -1 is off end
|
private java.util.List<java.lang.Object[]> |
rows
Results list; each row is an array of primary keys or DMOs
|
Constructor and Description |
---|
SimpleResults(java.util.List<java.lang.Object[]> rows)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow(java.lang.Object[] row,
boolean beforeRow)
Add a new row.
|
void |
cleanup()
Clear the internal list of result rows.
|
boolean |
deleteRow()
Delete the current row.
|
boolean |
first()
Move cursor to the first results row.
|
java.lang.Object[] |
get()
Get the array of objects at the current result row.
|
java.lang.Object |
get(int column)
Get the object at the current result row, at the specified column.
|
java.lang.Long |
getID(int column)
Get the primary key ID at the current result row, at the specified column.
|
int |
getNumberOfLoadedRows()
Returns the number of rows which have been loaded by this
Results . |
int |
getRowNumber()
Get the row number currently under the cursor.
|
protected java.util.List<java.lang.Object[]> |
getRows()
Get the list of row data which backs this results object.
|
boolean |
isFirst()
Is the cursor on the first row in the results set?
|
boolean |
isLast()
Is the cursor on the last row in the results set?
|
boolean |
isResultSetCached()
Indicate whether the full result set is cached in this object.
|
boolean |
last()
Move cursor to the last results row.
|
boolean |
next()
Move cursor to the next results row.
|
boolean |
previous()
Move cursor to the previous results row.
|
void |
reset()
Reset the cursor to its natural starting position, before the first result row.
|
boolean |
scroll(int rows)
Scroll the cursor ahead by the specified number of rows.
|
void |
sessionClosing()
Required by the
Results interface, but this is a no-op implementation. |
boolean |
setRowNumber(int row)
Set the row number currently under the cursor.
|
private final java.util.List<java.lang.Object[]> rows
private int position
public SimpleResults(java.util.List<java.lang.Object[]> rows)
rows
- List of row data.public boolean first()
public boolean last()
public boolean next()
public boolean previous()
public boolean isFirst()
public boolean isLast()
public java.lang.Object[] get()
public java.lang.Object get(int column)
public java.lang.Long getID(int column)
public int getRowNumber()
getRowNumber
in interface Results
-1
if the cursor is not currently
on a result.public boolean setRowNumber(int row)
setRowNumber
in interface Results
row
- Zero-based index of the row to be set as the current row.true
if there is a row at the specified row number, else false
.public boolean scroll(int rows)
public void reset()
public void sessionClosing()
Results
interface, but this is a no-op implementation.sessionClosing
in interface Results
public void cleanup()
public boolean isResultSetCached()
isResultSetCached
in interface Results
true
if all results are contained this object; false
if not or
if unknown (such as for a scrolling or cursored result set. Return value for this
default implementation is true
.public int getNumberOfLoadedRows()
Results
.getNumberOfLoadedRows
in interface Results
public boolean deleteRow()
public void addRow(java.lang.Object[] row, boolean beforeRow)
protected java.util.List<java.lang.Object[]> getRows()