From a2c7425458f645802a352abc4783e0afc73dba13 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Thu, 3 Dec 2020 19:22:35 -0500 Subject: Adapt to esodata changes --- .../main/java/bjc/utils/funcutils/TreeUtils.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'base/src/main/java/bjc/utils/funcutils/TreeUtils.java') diff --git a/base/src/main/java/bjc/utils/funcutils/TreeUtils.java b/base/src/main/java/bjc/utils/funcutils/TreeUtils.java index 59f60a2..41a01d8 100644 --- a/base/src/main/java/bjc/utils/funcutils/TreeUtils.java +++ b/base/src/main/java/bjc/utils/funcutils/TreeUtils.java @@ -21,8 +21,8 @@ public class TreeUtils { * The path to mark nodes with. * @return The list of marked paths. */ - public static IList> outlineTree(ITree tre, Predicate leafMarker) { - IList> paths = new FunctionalList<>(); + public static ListEx> outlineTree(Tree tre, Predicate leafMarker) { + ListEx> paths = new FunctionalList<>(); LinkedList path = new LinkedList<>(); path.add(tre.getHead()); @@ -33,11 +33,11 @@ public class TreeUtils { } /* Find a path in a tree. */ - private static void findPath(ITree subtree, LinkedList path, - Predicate leafMarker, IList> paths) { + private static void findPath(Tree subtree, LinkedList path, + Predicate leafMarker, ListEx> paths) { if (subtree.getChildrenCount() == 0 && leafMarker.test(subtree.getHead())) { /* We're at a matching leaf node. Add it. */ - IList finalPath = new FunctionalList<>(); + ListEx finalPath = new FunctionalList<>(); for (T ePath : path) finalPath.add(ePath); @@ -63,10 +63,10 @@ public class TreeUtils { * @param expander The function to expand nodes. * @return A transformed copy of the tree. */ - public static ITree substitute( - ITree tree, + public static Tree substitute( + Tree tree, Predicate marker, - Function> expander) { + Function> expander) { tree.topDownTransform((contents) -> { if (marker.test(contents)) return TopDownTransformResult.TRANSFORM; else return TopDownTransformResult.PASSTHROUGH; @@ -84,9 +84,9 @@ public class TreeUtils { * @param environment A map which contains the variables to substitute. * @return A transformed copy of the tree. */ - public static ITree substitute( - ITree tree, - IMap> environment) { + public static Tree substitute( + Tree tree, + MapEx> environment) { return substitute( tree, environment::containsKey, -- cgit v1.2.3