All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.scce.addlib.traverser.InorderTreeIterator Maven / Gradle / Ivy

Go to download

The Java Library for Algebraic Decision Diagrams, Code Generation, and Layouting

There is a newer version: 3.1.0
Show newest version
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;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy