org.aksw.commons.collections.trees.TreeOps2 Maven / Gradle / Ivy
package org.aksw.commons.collections.trees;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.BiPredicate;
import java.util.function.Function;
/**
* Class that groups several functions for tree traversal and modification.
*
* @author raven
*
* @param
*/
public class TreeOps2
{
protected Function> parentToChildren;
protected Function childToParent;
protected BiFunction, T> replaceChildren;
/**
* Predicate to test whether two nodes are equal
*/
protected BiPredicate isEquivalent;
public TreeOps2(Function> parentToChildren, Function childToParent, BiFunction, T> replaceChildren) {
super();
this.parentToChildren = parentToChildren;
this.childToParent = childToParent;
this.replaceChildren = replaceChildren;
}
public Function> getParentToChildren() {
return parentToChildren;
}
public Function getChildToParent() {
return childToParent;
}
public BiFunction, T> getReplaceChildren() {
return replaceChildren;
}
@Override
public String toString() {
return "TreeOps [parentToChildren=" + parentToChildren + ", childToParent=" + childToParent
+ ", replaceChildren=" + replaceChildren + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy