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 Persistable
object
(a DMO instance) or a Serializable
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 |
rows
Results list; each row is an array of primary keys or DMOs
|
Constructor and Description |
---|
SimpleResults(java.util.List rows)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.io.Serializable |
getID(int column)
Get the primary key ID at the current result row, at the specified column.
|
protected 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 |
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 |
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 rows
private int position
public SimpleResults(java.util.List 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.io.Serializable 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 deleteRow()
true
if the row was deleted. false
if there is no row at
the current position.protected java.util.List getRows()
protected int getNumberOfLoadedRows()
Results
.