public abstract class TreeWalker<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TreeWalker.NullCondition<S> |
static interface |
TreeWalker.WalkCondition<S> |
Modifier and Type | Field and Description |
---|---|
protected T |
currentElement |
protected List<Collector<T>> |
postCollectors |
protected List<Collector<T>> |
preCollectors |
Constructor and Description |
---|
TreeWalker(T initialElement) |
Modifier and Type | Method and Description |
---|---|
TreeWalker<T> |
addPostCollector(Collector<T> collector) |
TreeWalker<T> |
addPreCollector(Collector<T> collector) |
T |
getCurrentElement() |
protected abstract T |
nextElement() |
void |
walkUntil() |
T |
walkUntil(TreeWalker.WalkCondition<T> condition) |
void |
walkWhile() |
T |
walkWhile(TreeWalker.WalkCondition<T> condition) |
protected T currentElement
public TreeWalker(T initialElement)
protected abstract T nextElement()
public TreeWalker<T> addPreCollector(Collector<T> collector)
public TreeWalker<T> addPostCollector(Collector<T> collector)
public void walkWhile()
public void walkUntil()
public T walkWhile(TreeWalker.WalkCondition<T> condition)
public T walkUntil(TreeWalker.WalkCondition<T> condition)
public T getCurrentElement()
Copyright © 2018. All rights reserved.