HiRISE

HiRISE.HiReport.sql
Class ResultList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Map<String,Object>>
              extended by HiRISE.HiReport.model.PagedList
                  extended by HiRISE.HiReport.sql.ResultList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Map<String,Object>>, Collection<Map<String,Object>>, List<Map<String,Object>>, RandomAccess, org.displaytag.pagination.PaginatedList

public class ResultList
extends PagedList
implements org.displaytag.pagination.PaginatedList

Implements the Displaytag PaginatedList interface for Results, allowing only the specified page of a result set to be returned as a list.

Version:
1.9
See Also:
Serialized Form

Field Summary
static String ID
          CVS ID
 
Fields inherited from class HiRISE.HiReport.model.PagedList
ascending, DEFAULT_SIZE, len, opp, pos, sort
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ResultList(ResultSet rs)
          Create a new ResultList of the default page size, set to page 1.
ResultList(ResultSet rs, int page)
          Create a new ResultList of the default page size, set to a specific page.
ResultList(ResultSet rs, int page, int opp, boolean ascending)
          Create a new ResultList, set to a specific page, with a given page size.
 
Method Summary
 List<String> getColumnNames()
          Get the column names as returned by the database.
 List<Map<String,Object>> getList()
           
static Map<String,Object> getMap(ResultSetMetaData meta, ResultSet rs)
          Get a map of column names to values for the current row.
 
Methods inherited from class HiRISE.HiReport.model.PagedList
getFullListSize, getObjectsPerPage, getPageNumber, getSearchId, getSortCriterion, getSortDirection, setFullListSize, setObjectsPerPage, setPageNumber, setSortDirection
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.displaytag.pagination.PaginatedList
getFullListSize, getObjectsPerPage, getPageNumber, getSearchId, getSortCriterion, getSortDirection
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

ID

public static final String ID
CVS ID

See Also:
Constant Field Values
Constructor Detail

ResultList

public ResultList(ResultSet rs)
           throws SQLException
Create a new ResultList of the default page size, set to page 1.

Parameters:
rs - The data
Throws:
SQLException - Could not read data

ResultList

public ResultList(ResultSet rs,
                  int page)
           throws SQLException
Create a new ResultList of the default page size, set to a specific page.

Parameters:
rs - The data
page - The page number
Throws:
SQLException - Could not read data

ResultList

public ResultList(ResultSet rs,
                  int page,
                  int opp,
                  boolean ascending)
           throws SQLException
Create a new ResultList, set to a specific page, with a given page size.

Parameters:
rs - The data
page - The page number
opp - Objects (rows) per page
ascending - If true, it is sorted in ascending order
Throws:
SQLException - Could not read data
Method Detail

getColumnNames

public List<String> getColumnNames()
                            throws SQLException
Get the column names as returned by the database.

Returns:
column names
Throws:
SQLException - Could not read column names

getMap

public static final Map<String,Object> getMap(ResultSetMetaData meta,
                                              ResultSet rs)
                                       throws SQLException
Get a map of column names to values for the current row.

Parameters:
meta - query meta-data
rs - query result
Returns:
column names mapped to values
Throws:
SQLException - Error fetching values

getList

public List<Map<String,Object>> getList()
Specified by:
getList in interface org.displaytag.pagination.PaginatedList
Overrides:
getList in class PagedList
See Also:
PaginatedList.getList()

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona