From 4d449a9b96570e8c655fc303ca0ca81dab394e3d Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 20 May 2020 19:40:06 -0400 Subject: Update docs --- docs/jacoco-ut/bjc.everge/ReplSet.java.html | 69 ++++++++++++++++------------- 1 file changed, 38 insertions(+), 31 deletions(-) (limited to 'docs/jacoco-ut/bjc.everge/ReplSet.java.html') diff --git a/docs/jacoco-ut/bjc.everge/ReplSet.java.html b/docs/jacoco-ut/bjc.everge/ReplSet.java.html index 42da031..544bf8a 100644 --- a/docs/jacoco-ut/bjc.everge/ReplSet.java.html +++ b/docs/jacoco-ut/bjc.everge/ReplSet.java.html @@ -16,85 +16,92 @@ public class ReplSet { /** * Create a new blank set of pairs. */ - public ReplSet() { - parList = new ArrayList<>(); - } + public ReplSet() { + parList = new ArrayList<>(); + } /** * Create a new set of pairs using an existing list of pairs. * - * Changes to the list of pairs will carry across to the ReplSet, so be careful about that. + * Changes to the list of pairs will carry across to the ReplSet, so be careful + * about that. * * @param lst - * The list of pairs to use. + * The list of pairs to use. */ - public ReplSet(List<ReplPair> lst) { - parList = lst; - } + public ReplSet(List<ReplPair> lst) { + parList = lst; + } /** * Load a ReplSet from a file. + * * @param fName - * The file to load the ReplSet from. + * The file to load the ReplSet from. * @return A ReplSet, loaded from the file. - * @throws IOException if something goes badly reading it. + * @throws IOException + * if something goes badly reading it. */ public static ReplSet fromFile(String fName) throws IOException { - ReplSet rs = new ReplSet(); + ReplSet rs = new ReplSet(); - try (FileInputStream fis = new FileInputStream(fName); Scanner scn = new Scanner(fis)) { - rs.parList = ReplPair.readList(scn); + try (FileInputStream fis = new FileInputStream(fName); + Scanner scn = new Scanner(fis)) { + rs.parList = ReplPair.readList(scn); } - return rs; + return rs; } /** * Adds more pairs to the ReplSet. * * @param pars - * The pairs to add to the ReplSet. + * The pairs to add to the ReplSet. */ public void addPairs(List<ReplPair> pars) { - for (ReplPair par : pars) { - parList.add(par); - } + for (ReplPair par : pars) { + parList.add(par); + } // Resort the pairs into priority order - parList.sort(null); - } + parList.sort(null); + } /** * Adds more pairs to the ReplSet. * * @param pars - * The pairs to add to the ReplSet. + * The pairs to add to the ReplSet. */ public void addPairs(ReplPair... pars) { - for (ReplPair par : pars) { - parList.add(par); + for (ReplPair par : pars) { + parList.add(par); } // Resort the pairs into priority order - parList.sort(null); - } + parList.sort(null); + } /** * Apply the ReplSet to a string. * * @param val - * The string to apply the ReplSet to. + * The string to apply the ReplSet to. * * @return The result of applying the ReplSet. */ public String apply(String val) { - String ret = val; + String ret = val; - for (ReplPair par : parList) { - ret = par.apply(ret); - } + for (ReplPair par : parList) { + System.err.printf("Applying pair '%s' to string '%s' (original was '%s')\n", par, ret, val); + String tmp = par.apply(ret); - return ret; + ret = tmp; + } + + return ret; } } \ No newline at end of file -- cgit v1.2.3