インターフェース Window<T>
- すべてのスーパーインターフェース:
IterableSE<T>、Streamable<T>、SupplierSE<StreamSE<T>>
基礎となるクエリ結果から消費されるデータのセット。
Window は、大規模な結果セットを簡単にスクロールできるように実際のクエリ結果のサブセットが含まれるという点で Slice に似ています。ウィンドウは、クエリでインデックス / オフセット、キーセットベースのページネーション、カーソル再開トークンが使用されたかどうかにかかわらず、実際のデータ取得についてはあまり意見を持ちません。- 導入:
- 3.1
- 作成者:
- Mark Paluch, Christoph Strobl
- 関連事項:
メソッドのサマリー
修飾子と型メソッド説明static <T> Window<T>from(ListSE<T> items, IntFunctionSE<? extends ScrollPosition> positionFunction) Windowを作成します。static <T> Window<T>from(ListSE<T> items, IntFunctionSE<? extends ScrollPosition> positionFunction, boolean hasNext) Windowを作成します。Windows のコンテンツをListSE として返します。booleanhasNext()次のウィンドウがある場合に戻ります。default booleanhasPosition(int index) 基になるスクロールメカニズムがindexでScrollPositionを提供できるかどうかを返します。booleanisEmpty()このウィンドウに要素が含まれていない場合は、trueを返します。default booleanisLast()現在のウィンドウが最後のウィンドウかどうかを返します。<U> Window<U>map(FunctionSE<? super T, ? extends U> converter) positionAt(int index) indexでScrollPositionを返します。default ScrollPositionpositionAt(T object) objectのScrollPositionを返します。intsize()このウィンドウ内の要素の数を返します。インターフェース java.lang.IterableSE から継承されたメソッド
forEachSE, iterator, spliterator
メソッドの詳細
from
static <T> Window<T> from(ListSE<T> items, IntFunctionSE<? extends ScrollPosition> positionFunction) Windowを作成します。- 型パラメーター:
T-- パラメーター:
items- データのリスト。positionFunction- データのリスト。- 戻り値:
Window
from
static <T> Window<T> from(ListSE<T> items, IntFunctionSE<? extends ScrollPosition> positionFunction, boolean hasNext) Windowを作成します。- 型パラメーター:
T-- パラメーター:
items- データのリスト。positionFunction- データのリスト。hasNext-- 戻り値:
Window
size
int size()このウィンドウ内の要素の数を返します。- 戻り値:
- このウィンドウ内の要素の数。
isEmpty
boolean isEmpty()このウィンドウに要素が含まれていない場合は、trueを返します。- 次で指定:
- インターフェース
Streamable<T>のisEmpty - 戻り値:
true(このウィンドウに要素が含まれていない場合)
getContent
Windows のコンテンツをListSE として返します。- 戻り値:
isLast
default boolean isLast()現在のウィンドウが最後のウィンドウかどうかを返します。- 戻り値:
hasNext
boolean hasNext()次のウィンドウがある場合に戻ります。- 戻り値:
- 次のウィンドウがある場合。
hasPosition
default boolean hasPosition(int index) 基になるスクロールメカニズムがindexでScrollPositionを提供できるかどうかを返します。- パラメーター:
index-- 戻り値:
-
ScrollPositionを作成できる場合はtrue。それ以外の場合はfalse。 - 関連事項:
positionAt
indexでScrollPositionを返します。- パラメーター:
index-- 戻り値:
- 例外:
IndexOutOfBoundsExceptionSE- インデックスが範囲外の場合 (index < 0 || index >= size())。IllegalStateExceptionSE- 基礎となるスクロール機構が特定のオブジェクトのスクロール位置を提供できない場合。
positionAt
objectのScrollPositionを返します。- パラメーター:
object-- 戻り値:
- 例外:
NoSuchElementExceptionSE- オブジェクトが結果の一部ではない場合。IllegalStateExceptionSE- 基礎となるスクロール機構が特定のオブジェクトのスクロール位置を提供できない場合。
map
- 次で指定:
- インターフェース
Streamable<T>のmap - パラメーター:
converter- null であってはなりません。- 戻り値:
- 指定された
converterによってマップされた現在のWindowのコンテンツを含む新しいWindow。 - 関連事項: