public class SimpleGridDataModel extends Object implements GridDataModel
Use it for quick tests and for simple grids.
| Constructor and Description |
|---|
SimpleGridDataModel(Object[][] data)
Creates an instance of this class and initializes it with the specified data set.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrentPageNumber()
This method gets a current page number.
|
Object[][] |
getData()
Getter for property 'data'.
|
int |
getDisplayedPages()
This method gets the number of pages links to be displayed.
|
int |
getEndPage()
This method returns an end page number.
|
int |
getEndRow()
This method returns an end row number.
|
protected Pageable |
getPageable()
Getter for property 'pageable'.
|
int |
getPageSize()
This method returns a page size.
|
Object[] |
getRowData(int rowNumber)
This method returns row data by the specified row number.
|
int |
getSortColumn()
This method returns a sorted column number.
|
int |
getStartPage()
This method returns a start page number.
|
int |
getStartRow()
This method returns a start row number.
|
int |
getTotalPagesNumber()
This method returns a number of existing pages.
|
int |
getTotalRowCount()
This method returns total row count value.
|
boolean |
isAscending()
This method defines sorting direction.
|
boolean |
isEmpty()
This method checks whether the data model is empty.
|
void |
setAscending(boolean ascending)
This method sets sort direction.
|
void |
setCurrentPageNumber(int currentPageNumber)
This method sets the current page number.
|
void |
setDisplayedPages(int displayedPages)
This method sets the number of pages links to be displayed.
|
protected void |
setPageable(Pageable pageable)
Setter for property 'pageable'.
|
void |
setPageSize(int pageSize)
This method sets a page size.
|
void |
setSortColumn(int sortColumn)
This method sets a number of sort column.
|
String |
toString() |
public SimpleGridDataModel(Object[][] data)
data - is a data set.public int getTotalRowCount()
getTotalRowCount in interface GridDataModelpublic int getStartRow()
getStartRow in interface GridDataModelpublic int getEndRow()
getEndRow in interface GridDataModelpublic int getSortColumn()
getSortColumn in interface GridDataModelpublic boolean isAscending()
It returns true if direction is ascending.
isAscending in interface GridDataModelfalse if sorting is descending.public Object[] getRowData(int rowNumber)
getRowData in interface GridDataModelrowNumber - is a number of row to be returned.public void setSortColumn(int sortColumn)
setSortColumn in interface GridDataModelsortColumn - a number of sort column.public void setAscending(boolean ascending)
setAscending in interface GridDataModelascending - sort direction.public boolean isEmpty()
isEmpty in interface GridDataModeltrue if the model is empty.public Object[][] getData()
getData in interface GridDataModelpublic void setPageSize(int pageSize)
setPageSize in interface PageablepageSize - is a page size.public void setCurrentPageNumber(int currentPageNumber)
throws IllegalArgumentException
setCurrentPageNumber in interface PageablecurrentPageNumber - is a current page number.IllegalArgumentException - if current page number less then zero or greater then
actual number of pages.public int getDisplayedPages()
getDisplayedPages in interface Pageablepublic void setDisplayedPages(int displayedPages)
setDisplayedPages in interface PageabledisplayedPages - is a number of pages.public int getTotalPagesNumber()
getTotalPagesNumber in interface Pageablepublic int getStartPage()
getStartPage in interface Pageablepublic int getEndPage()
getEndPage in interface Pageablepublic int getPageSize()
getPageSize in interface Pageablepublic int getCurrentPageNumber()
getCurrentPageNumber in interface Pageableprotected Pageable getPageable()
protected void setPageable(Pageable pageable)
pageable - Value to set for property 'pageable'.Copyright © 2008–2013. All rights reserved.