Class OneSubsetOneSetPagingCalculator
java.lang.Object
org.gvsig.tools.paging.DefaultPagingCalculator
org.gvsig.fmap.dal.feature.paging.impl.OneSubsetOneSetPagingCalculator
- All Implemented Interfaces:
org.gvsig.tools.paging.PagingCalculator
public class OneSubsetOneSetPagingCalculator
extends org.gvsig.tools.paging.DefaultPagingCalculator
Performs the calculations needed to be able to do pagination with two Sets of
data which must be viewed as a single set of data. The first set is supposed
to be a subset of the second one, so the size of the first set must be
subtracted from the second one.
- Author:
- gvSIG team
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gvsig.tools.paging.PagingCalculator
org.gvsig.tools.paging.PagingCalculator.Sizeable -
Field Summary
Fields inherited from interface org.gvsig.tools.paging.PagingCalculator
DEFAULT_PAGE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionOneSubsetOneSetPagingCalculator(org.gvsig.tools.paging.PagingCalculator.Sizeable firstSet, org.gvsig.tools.paging.PagingCalculator.Sizeable secondSet, int maxPageSize) OneSubsetOneSetPagingCalculator(org.gvsig.tools.paging.PagingCalculator.Sizeable firstSet, org.gvsig.tools.paging.PagingCalculator.Sizeable secondSet, int maxPageSize, long currentPage) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of elements of the current page into the first set.longReturns the index of the first element in the page which is available into the first set, if the current page has elements on it.longReturns the size of the first set.longReturns the number of elements of the current page into the second set.longReturns the index of the first element in the page which is available into the second set, if the current page has elements on it.longReturns the size of the second set.longprotected booleanReturns if the current page has all its values into the first set.booleanReturns if the current page has any of its values into the first set.booleanReturns if the current page has any of its values into the second set.Methods inherited from class org.gvsig.tools.paging.DefaultPagingCalculator
getCurrentPage, getCurrentPageSize, getInitialIndex, getLastIndex, getMaxPageSize, getNumPages, setCurrentPage, setMaxPageSize
-
Constructor Details
-
OneSubsetOneSetPagingCalculator
public OneSubsetOneSetPagingCalculator(org.gvsig.tools.paging.PagingCalculator.Sizeable firstSet, org.gvsig.tools.paging.PagingCalculator.Sizeable secondSet, int maxPageSize) - Parameters:
firstSet- the first set of elements to calculate pagination forsecondSet- the second set of elements to calculate pagination for
-
OneSubsetOneSetPagingCalculator
public OneSubsetOneSetPagingCalculator(org.gvsig.tools.paging.PagingCalculator.Sizeable firstSet, org.gvsig.tools.paging.PagingCalculator.Sizeable secondSet, int maxPageSize, long currentPage) - Parameters:
firstSet- the first set of elements to calculate pagination forsecondSet- the second set of elements to calculate pagination for
-
-
Method Details
-
getTotalSize
public long getTotalSize()- Specified by:
getTotalSizein interfaceorg.gvsig.tools.paging.PagingCalculator- Overrides:
getTotalSizein classorg.gvsig.tools.paging.DefaultPagingCalculator
-
getFirstSetSize
public long getFirstSetSize()Returns the size of the first set.- Returns:
- the first set size
-
getSecondSetSize
public long getSecondSetSize()Returns the size of the second set.- Returns:
- the second set size
-
getFirstSetInitialIndex
public long getFirstSetInitialIndex()Returns the index of the first element in the page which is available into the first set, if the current page has elements on it.- Returns:
- the index of the first element into the first set
-
getSecondSetInitialIndex
public long getSecondSetInitialIndex()Returns the index of the first element in the page which is available into the second set, if the current page has elements on it.- Returns:
- the index of the first element into the second set
-
getFirstSetHowMany
public long getFirstSetHowMany()Returns the number of elements of the current page into the first set.- Returns:
- the number of elements of the current page into the first set
-
getSecondSetHowMany
public long getSecondSetHowMany()Returns the number of elements of the current page into the second set.- Returns:
- the number of elements of the current page into the second set
-
hasCurrentPageAllValuesInFirstSet
protected boolean hasCurrentPageAllValuesInFirstSet()Returns if the current page has all its values into the first set.- Returns:
- if the current page has all its values into the first set
-
hasCurrentPageAnyValuesInFirstSet
public boolean hasCurrentPageAnyValuesInFirstSet()Returns if the current page has any of its values into the first set.- Returns:
- if the current page has any of its values into the first set
-
hasCurrentPageAnyValuesInSecondSet
public boolean hasCurrentPageAnyValuesInSecondSet()Returns if the current page has any of its values into the second set.- Returns:
- if the current page has any of its values into the second set
-