info.scce.addlib.traverser.InorderTreeIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of addlib Show documentation
Show all versions of addlib Show documentation
The Java Library for Algebraic Decision Diagrams, Code Generation, and Layouting
package info.scce.addlib.traverser;
import info.scce.addlib.dd.DD;
import java.util.Collections;
import java.util.List;
public class InorderTreeIterator> extends RecursiveTreeIterator {
public InorderTreeIterator(D root) {
this(Collections.singletonList(root));
}
public InorderTreeIterator(List root) {
super(root);
}
@Override
protected D processDD(D f, int i) {
switch (i) {
case 0:
if (!f.isConstant())
pushDD(f.e());
return null;
case 1:
return f;
case 2:
if (!f.isConstant())
pushDD(f.t());
return null;
default:
popDD();
return null;
}
}
}