T
- データソースが提供する値の型U
- 反復子が返す値の型public final class LazyIterable<T,U> extends Object implements Iterable<U>
Iterator
を提供するIterable
の実装クラス.
このクラスのiterator()
メソッドが返す反復子Iterator
はデータソースからの値を取得を可能な限り遅らせる。
なお反復子のメソッドIterator.remove()
はサポートされておらず、
呼びだされた場合はかならず例外UnsupportedOperationException
をスローする。
修飾子とタイプ | クラスと説明 |
---|---|
static interface |
LazyIterable.Supplier<T>
データソースを表すインターフェース.
|
static class |
LazyIterable.Yield<T>
LazyIterable.YieldCallable.yield(Object, int) が値を返すのに用いるコンテナ. |
static interface |
LazyIterable.YieldCallable<T,U>
遅延評価による反復子のためユーザが実装するインターフェース.
|
修飾子とタイプ | メソッドと説明 |
---|---|
static <T,U> LazyIterable<T,U> |
forEach(Iterable<T> source,
LazyIterable.YieldCallable<T,U> callable)
|
static <T,U> LazyIterable<T,U> |
forEach(LazyIterable.Supplier<T> source,
LazyIterable.YieldCallable<T,U> callable)
LazyIterable.Supplier をデータソースとするIterable を生成して返す. |
static <T,U> LazyIterable<T,U> |
forOnce(T source,
LazyIterable.YieldCallable<T,U> callable)
単一値をデータソースとする
Iterable を生成して返す. |
Iterator<U> |
iterator() |
List<U> |
toList() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static <T,U> LazyIterable<T,U> forOnce(T source, LazyIterable.YieldCallable<T,U> callable)
Iterable
を生成して返す.public static <T,U> LazyIterable<T,U> forEach(Iterable<T> source, LazyIterable.YieldCallable<T,U> callable)
public static <T,U> LazyIterable<T,U> forEach(LazyIterable.Supplier<T> source, LazyIterable.YieldCallable<T,U> callable)
T
- データソースから取得されるオブジェクトの型U
- Iterable
の要素型source
- データソースとなるLazyIterable.Supplier
callable
- データソースから取得された値をもとに判断・加工を行ってその値と制御情報を反復子に提供するインターフェースIterable
のインスタンスCopyright © 2016. All rights reserved.