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

org.aksw.commons.collections.trees.TreeOps2 Maven / Gradle / Ivy

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