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 --- .../java/bjc/utils/ioutils/RegexStringEditor.java | 12 ++++++------ .../bjc/utils/ioutils/RuleBasedConfigReader.java | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'base/src/main/java/bjc/utils/ioutils') diff --git a/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java b/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java index 3dad724..e7d8c54 100644 --- a/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java +++ b/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java @@ -8,7 +8,7 @@ import java.util.regex.Pattern; import bjc.data.Toggle; import bjc.data.ValueToggle; import bjc.funcdata.FunctionalList; -import bjc.funcdata.IList; +import bjc.funcdata.ListEx; import bjc.functypes.ID; /** @@ -84,7 +84,7 @@ public class RegexStringEditor { /* * Get all of the occurances. */ - final IList occurances = listOccurances(input, rPatt); + final ListEx occurances = listOccurances(input, rPatt); /* * Execute the correct action on every occurance. @@ -118,13 +118,13 @@ public class RegexStringEditor { * * @return The string, with both actions applied. */ - public static IList mapOccurances(final String input, final Pattern rPatt, + public static ListEx mapOccurances(final String input, final Pattern rPatt, final UnaryOperator betweenAction, final UnaryOperator onAction) { /* * Get all of the occurances. */ - final IList occurances = listOccurances(input, rPatt); + final ListEx occurances = listOccurances(input, rPatt); /* * Execute the correct action on every occurance. @@ -146,8 +146,8 @@ public class RegexStringEditor { * @return The string, as a list of match/non-match segments, starting/ending * with a non-match segment. */ - public static IList listOccurances(final String input, final Pattern rPatt) { - final IList res = new FunctionalList<>(); + public static ListEx listOccurances(final String input, final Pattern rPatt) { + final ListEx res = new FunctionalList<>(); /* * Create the matcher and work buffer. diff --git a/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java b/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java index bc19dd9..12534bd 100644 --- a/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java +++ b/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java @@ -6,14 +6,14 @@ import java.util.Scanner; import java.util.function.BiConsumer; import java.util.function.Consumer; -import bjc.data.IHolder; -import bjc.data.IPair; -import bjc.data.Identity; +import bjc.data.Holder; import bjc.data.Pair; +import bjc.data.Identity; +import bjc.data.SimplePair; import bjc.utils.exceptions.UnknownPragma; import bjc.funcdata.FunctionalMap; import bjc.funcdata.FunctionalStringTokenizer; -import bjc.funcdata.IMap; +import bjc.funcdata.MapEx; /** * This class parses a rules based config file, and uses it to drive a provided @@ -31,7 +31,7 @@ public class RuleBasedConfigReader { * * Takes the tokenizer, and a pair of the read token and application state */ - private BiConsumer> start; + private BiConsumer> start; /* * Function to use when continuing a rule. @@ -52,7 +52,7 @@ public class RuleBasedConfigReader { * * Pragma actions are functions taking a tokenizer and application state */ - private final IMap> pragmas; + private final MapEx> pragmas; /** * Create a new rule-based config reader @@ -65,7 +65,7 @@ public class RuleBasedConfigReader { * The action to fire when ending a rule */ public RuleBasedConfigReader( - final BiConsumer> start, + final BiConsumer> start, final BiConsumer continueRule, final Consumer end) { this.start = start; @@ -161,7 +161,7 @@ public class RuleBasedConfigReader { /* * This is true when a rule's open */ - final IHolder isRuleOpen = new Identity<>(false); + final Holder isRuleOpen = new Identity<>(false); /* * Do something for every line of the file @@ -237,7 +237,7 @@ public class RuleBasedConfigReader { * The action to execute on starting of a rule */ public void setStartRule( - final BiConsumer> start) { + final BiConsumer> start) { if (start == null) throw new NullPointerException("Action on rule start must be non-null"); @@ -284,7 +284,7 @@ public class RuleBasedConfigReader { /* * Start a rule */ - start.accept(tokenizer, new Pair<>(nextToken, state)); + start.accept(tokenizer, new SimplePair<>(nextToken, state)); isRuleOpen = true; } -- cgit v1.2.3