
impl.childtrees.MutableChildTreeWithImmutableChilds Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flexible-tree Show documentation
Show all versions of flexible-tree Show documentation
Library for generating permutation of given value domains
The newest version!
package impl.childtrees;
import api.Node;
import api.Tree;
import exception.TreeInsertionException;
import impl.nodes.ImmutableNode;
/**
* Created by chief on 04.07.17.
*/
public class MutableChildTreeWithImmutableChilds extends DefaultMutableChildTree {
public MutableChildTreeWithImmutableChilds(Tree mainTree) {
super(mainTree);
}
@Override
public void addNode(Node node) throws TreeInsertionException {
if (!(node instanceof ImmutableNode
&& ((ImmutableNode) node).getChildTree() instanceof MutableChildTreeWithImmutableChilds)){
throw new IllegalArgumentException(String.format("This child tree only supports Nodes of type %s with child tree of type %s",
ImmutableNode.class.getSimpleName(), MutableChildTreeWithImmutableChilds.class.getSimpleName()));
}
super.addNode(node);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy