public class DataSetManipulator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ICON_FIRST |
static java.lang.String |
ICON_LAST |
static java.lang.String |
ICON_NEXT |
static java.lang.String |
ICON_PREV |
Constructor and Description |
---|
DataSetManipulator(int pageSizeIn,
java.util.List datasetIn,
javax.servlet.http.HttpServletRequest requestIn,
java.lang.String listNameIn,
boolean parentIsElement)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
bindPaginationInfo()
Binds information pertaining to pagination to the request
|
void |
filter(ListFilter f,
javax.servlet.jsp.PageContext context)
Filters the dataset based on filter criteria
|
int |
findAlphaPosition()
Finds the first instance of an entry in DataSet that starts with the letter
"alphaPosition"
|
java.util.List |
getAllData()
Return everything in the list, not just enough for a single page
|
java.util.Set<java.lang.Character> |
getAlphaBarIndex()
Gets the set of characters that will be active on the alpha bar
|
java.lang.String |
getDefaultSortAttribute() |
int |
getNextPageNumber()
Returns the next page number
|
java.util.List |
getPage()
Find a page-worth of data
|
java.util.Map |
getPaginationLinks()
Builds a map of bog-standard pagination links complete with images
|
java.lang.String |
getPaginationMessage()
Returns the pagination message (1 - 2 of 3 for example)
|
int |
getPrevPageNumber()
Returns the previous page number
|
int |
getTotalDataSetSize()
Get the total (non-filtered, non-paginated) dataset size
|
int |
getUnfilteredDataSize() |
boolean |
isFirstPage()
Is the current page the first page?
|
boolean |
isLastPage()
Is the current page the last page?
|
boolean |
isListEmpty()
Is the list empty?
|
void |
setAlphaColumn(java.lang.String col)
setter for the column that will be sorted when the alpha bar is used
|
void |
setDefaultAscending(boolean asc) |
void |
setDefaultSortAttribute(java.lang.String sortAttr) |
void |
sort()
Sorts the dataset in place
|
public static final java.lang.String ICON_FIRST
public static final java.lang.String ICON_PREV
public static final java.lang.String ICON_NEXT
public static final java.lang.String ICON_LAST
public DataSetManipulator(int pageSizeIn, java.util.List datasetIn, javax.servlet.http.HttpServletRequest requestIn, java.lang.String listNameIn, boolean parentIsElement)
pageSizeIn
- page size of the listdatasetIn
- dataset to be displayedrequestIn
- HttpServletRequest of the callerlistNameIn
- name of the listparentIsElement
- true of the parent value
in the list should be considered as an element
this is useful for tree like datapublic int getTotalDataSetSize()
public java.util.List getPage()
public java.util.List getAllData()
public java.lang.String getPaginationMessage()
public void bindPaginationInfo()
public int getNextPageNumber()
public int getPrevPageNumber()
public boolean isFirstPage()
public boolean isLastPage()
public void sort()
public void filter(ListFilter f, javax.servlet.jsp.PageContext context) throws javax.servlet.jsp.JspException
f
- ListFilter instancecontext
- the page context to write tojavax.servlet.jsp.JspException
- if failure to write to pageContextpublic java.util.Map getPaginationLinks()
public boolean isListEmpty()
public java.util.Set<java.lang.Character> getAlphaBarIndex()
public void setAlphaColumn(java.lang.String col)
col
- the column to setpublic int findAlphaPosition()
public java.lang.String getDefaultSortAttribute()
public void setDefaultSortAttribute(java.lang.String sortAttr)
sortAttr
- the default sort attributepublic void setDefaultAscending(boolean asc)
asc
- the sort orderpublic int getUnfilteredDataSize()