Interface IDataSource.IQueryResult<T>

Type Parameters:
T - row/item model object type
Enclosing interface:
IDataSource<T>

public static interface IDataSource.IQueryResult<T>
Used to pass the total row count and the loaded item to the caller of IDataSource.query(IDataSource.IQuery, IDataSource.IQueryResult) method.
Author:
Matej Knopp
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Constant indicating that there are more items left.
    static final int
    Constant indicating that there are no more items left.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setItems(Iterator<? extends T> items)
    Sets the actual loaded items.
    void
    setTotalCount(long count)
    Sets the total items count.
  • Field Details

    • MORE_ITEMS

      static final int MORE_ITEMS
      Constant indicating that there are more items left.
      See Also:
    • NO_MORE_ITEMS

      static final int NO_MORE_ITEMS
      Constant indicating that there are no more items left.
      See Also:
  • Method Details

    • setTotalCount

      void setTotalCount(long count)
      Sets the total items count. Alternatively, if the total item count can't be determined, either MORE_ITEMS or NO_MORE_ITEMS constant can be used to indicate whether there are more items left or not. If the real items count is specified, it might affect the result of IDataSource.IQuery.getCount(), so it is preferred to call this method before calling setItems(Iterator).
      Parameters:
      count - the total count of items
    • setItems

      void setItems(Iterator<? extends T> items)
      Sets the actual loaded items.
      Parameters:
      items - iterator able to iterate through the loaded items.