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

    Constructors
    Constructor
    Description
    OneSubsetOneSetPagingCalculator(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 Type
    Method
    Description
    long
    Returns the number of elements of the current page into the first set.
    long
    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.
    long
    Returns the size of the first set.
    long
    Returns the number of elements of the current page into the second set.
    long
    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.
    long
    Returns the size of the second set.
    long
     
    protected boolean
    Returns if the current page has all its values into the first set.
    boolean
    Returns if the current page has any of its values into the first set.
    boolean
    Returns 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 for
      secondSet - 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 for
      secondSet - the second set of elements to calculate pagination for
  • Method Details

    • getTotalSize

      public long getTotalSize()
      Specified by:
      getTotalSize in interface org.gvsig.tools.paging.PagingCalculator
      Overrides:
      getTotalSize in class org.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