# RecursiveTreeIterator クラス

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

## はじめに

RecursiveIterator を反復処理し、ASCII グラフィックツリーを生成します。

## クラス概要

class RecursiveTreeIterator extends RecursiveIteratorIterator {
/* 継承した定数 */
public const int RecursiveIteratorIterator::LEAVES_ONLY;
public const int RecursiveIteratorIterator::SELF_FIRST;
public const int RecursiveIteratorIterator::CHILD_FIRST;
public const int RecursiveIteratorIterator::CATCH_GET_CHILD;
/* 定数 */
public const int BYPASS_CURRENT;
public const int BYPASS_KEY;
public const int PREFIX_LEFT;
public const int PREFIX_MID_HAS_NEXT = 1;
public const int PREFIX_MID_LAST = 2;
public const int PREFIX_END_HAS_NEXT = 3;
public const int PREFIX_END_LAST = 4;
public const int PREFIX_RIGHT = 5;
/* メソッド */
public function __construct(
RecursiveIterator|IteratorAggregate `$iterator`,
int `$flags` = `RecursiveTreeIterator::BYPASS_KEY`,
int `$cachingIteratorFlags` = `CachingIterator::CATCH_GET_CHILD`,
int `$mode` = `RecursiveTreeIterator::SELF_FIRST`
)
public function beginChildren(): void
public function beginIteration(): RecursiveIterator
public function callGetChildren(): RecursiveIterator
public function callHasChildren(): bool
public function current(): mixed
public function endChildren(): void
public function endIteration(): void
public function getEntry(): string
public function getPostfix(): string
public function getPrefix(): string
public function key(): mixed
public function next(): void
public function nextElement(): void
public function rewind(): void
public function setPostfix(string `$postfix`): void
public function setPrefixPart(int `$part`, string `$value`): void
public function valid(): bool
/* 継承したメソッド */
public function RecursiveIteratorIterator::beginChildren(): void
public function RecursiveIteratorIterator::beginIteration(): void
public function RecursiveIteratorIterator::callGetChildren(): ?RecursiveIterator
public function RecursiveIteratorIterator::callHasChildren(): bool
public function RecursiveIteratorIterator::current(): mixed
public function RecursiveIteratorIterator::endChildren(): void
public function RecursiveIteratorIterator::endIteration(): void
public function RecursiveIteratorIterator::getDepth(): int
public function RecursiveIteratorIterator::getInnerIterator(): RecursiveIterator
public function RecursiveIteratorIterator::getMaxDepth(): int|false
public function RecursiveIteratorIterator::getSubIterator(?int `$level` = `null`): ?RecursiveIterator
public function RecursiveIteratorIterator::key(): mixed
public function RecursiveIteratorIterator::next(): void
public function RecursiveIteratorIterator::nextElement(): void
public function RecursiveIteratorIterator::rewind(): void
public function RecursiveIteratorIterator::setMaxDepth(int `$maxDepth` = -1): void
public function RecursiveIteratorIterator::valid(): bool
}

## 定義済み定数

`RecursiveTreeIterator::BYPASS_CURRENT`

`RecursiveTreeIterator::BYPASS_KEY`

`RecursiveTreeIterator::PREFIX_LEFT`

`RecursiveTreeIterator::PREFIX_MID_HAS_NEXT`

`RecursiveTreeIterator::PREFIX_MID_LAST`

`RecursiveTreeIterator::PREFIX_END_HAS_NEXT`

`RecursiveTreeIterator::PREFIX_END_LAST`

`RecursiveTreeIterator::PREFIX_RIGHT`

## 目次

- RecursiveTreeIterator::beginChildren — 子を開始する
- RecursiveTreeIterator::beginIteration — 反復処理を開始する
- RecursiveTreeIterator::callGetChildren — 子を取得する
- RecursiveTreeIterator::callHasChildren — 子を持っているかどうかを調べる
- RecursiveTreeIterator::__construct — RecursiveTreeIterator を作成する
- RecursiveTreeIterator::current — 現在の要素を取得する
- RecursiveTreeIterator::endChildren — 子を終了する
- RecursiveTreeIterator::endIteration — 反復処理を終了する
- RecursiveTreeIterator::getEntry — 現在のエントリを取得する
- RecursiveTreeIterator::getPostfix — 接尾辞を取得する
- RecursiveTreeIterator::getPrefix — 接頭辞を取得する
- RecursiveTreeIterator::key — 現在の要素のキーを取得する
- RecursiveTreeIterator::next — 次の要素に移動する
- RecursiveTreeIterator::nextElement — 次の要素
- RecursiveTreeIterator::rewind — イテレータを巻き戻す
- RecursiveTreeIterator::setPostfix — postfix を設定する
- RecursiveTreeIterator::setPrefixPart — 接頭辞の部分を設定する
- RecursiveTreeIterator::valid — 有効性を調べる

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open