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 GridDataModel
public int getStartRow()
getStartRow
in interface GridDataModel
public int getEndRow()
getEndRow
in interface GridDataModel
public int getSortColumn()
getSortColumn
in interface GridDataModel
public boolean isAscending()
It returns true
if direction is ascending.
isAscending
in interface GridDataModel
false
if sorting is descending.public Object[] getRowData(int rowNumber)
getRowData
in interface GridDataModel
rowNumber
- is a number of row to be returned.public void setSortColumn(int sortColumn)
setSortColumn
in interface GridDataModel
sortColumn
- a number of sort column.public void setAscending(boolean ascending)
setAscending
in interface GridDataModel
ascending
- sort direction.public boolean isEmpty()
isEmpty
in interface GridDataModel
true
if the model is empty.public Object[][] getData()
getData
in interface GridDataModel
public void setPageSize(int pageSize)
setPageSize
in interface Pageable
pageSize
- is a page size.public void setCurrentPageNumber(int currentPageNumber) throws IllegalArgumentException
setCurrentPageNumber
in interface Pageable
currentPageNumber
- 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 Pageable
public void setDisplayedPages(int displayedPages)
setDisplayedPages
in interface Pageable
displayedPages
- is a number of pages.public int getTotalPagesNumber()
getTotalPagesNumber
in interface Pageable
public int getStartPage()
getStartPage
in interface Pageable
public int getEndPage()
getEndPage
in interface Pageable
public int getPageSize()
getPageSize
in interface Pageable
public int getCurrentPageNumber()
getCurrentPageNumber
in interface Pageable
protected Pageable getPageable()
protected void setPageable(Pageable pageable)
pageable
- Value to set for property 'pageable'.Copyright © 2008–2013. All rights reserved.