com.link_intersystems.graph.tree.AbstractTreeModelIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lis-commons-graph Show documentation
Show all versions of lis-commons-graph Show documentation
Link Intersystems Commons Graph (lis-commons-graph) is a collection of reusable software components
that provide support for graph and tree related programming tasks, such as models and search algorithms.
package com.link_intersystems.graph.tree;
import java.util.Iterator;
import static java.util.Objects.requireNonNull;
/**
* @author René Link {@literal }
*/
public abstract class AbstractTreeModelIterable implements Iterable {
protected TreeModel treeModel;
protected T rootElement;
public AbstractTreeModelIterable(TreeModel treeModel, T rootElement) {
this.treeModel = requireNonNull(treeModel);
this.rootElement = requireNonNull(rootElement);
}
@Override
public Iterator iterator() {
return createIterator(treeModel, rootElement);
}
protected abstract Iterator createIterator(TreeModel treeModel, T rootElement);
}