public final class UnitTreeNodesIterable extends Object implements Iterable<Unit>
Iterable
オブジェクト.
初期化の際に指定されたユニットが子孫ユニットの探索の起点となる。 反復処理の対象ユニットのなかに起点となるユニットが含まれるかどうかは初期化時のパラメータで制御できる。
iterator()
が返すIterator
オブジェクトの
Iterator.remove()
メソッドはサポートされていない。
修飾子とタイプ | メソッドと説明 |
---|---|
Unit |
getRoot()
探索の起点となるユニットを返す.
|
boolean |
isDepthFirst()
探索が深さ優先で行われるかどうかを示す.
|
boolean |
isIncludingRoot() |
Iterator<Unit> |
iterator() |
static UnitTreeNodesIterable |
ofBreadthFirst(Unit root,
boolean includesRoot)
幅優先探索を行う
Iterable を返す. |
static UnitTreeNodesIterable |
ofDepthFirst(Unit root,
boolean includesRoot)
深さ優先探索を行う
Iterable を返す. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static UnitTreeNodesIterable ofDepthFirst(Unit root, boolean includesRoot)
Iterable
を返す.root
- 探索の起点となるユニットincludesRoot
- true
の場合 反復子が返すユニットに起点となる要素も含まれるIterable
インスタンスpublic static UnitTreeNodesIterable ofBreadthFirst(Unit root, boolean includesRoot)
Iterable
を返す.root
- 探索の起点となるユニットincludesRoot
- true
の場合 反復子が返すユニットに起点となる要素も含まれるIterable
インスタンスpublic Unit getRoot()
このユニットは反復子Iterator
から取得できるユニットには含まれない。
public boolean isDepthFirst()
true
の場合 探索は深さ優先に行われるpublic boolean isIncludingRoot()
Copyright © 2016. All rights reserved.