summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2019-06-24 20:38:16 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2019-06-24 20:38:16 -0400
commit63ec2f8e2d1af65f03a74c57ae2bc6c9cdafa19f (patch)
tree1dd4b6edca46d28ff5000e81c492572058d8c8bb
parenteb703a69c83a0bdb3d2172b0bd26d38188ecbe86 (diff)
Add some comments
-rw-r--r--src/main/java/bjc/everge/ReplPair.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/main/java/bjc/everge/ReplPair.java b/src/main/java/bjc/everge/ReplPair.java
index 6acc6ad..2d2e115 100644
--- a/src/main/java/bjc/everge/ReplPair.java
+++ b/src/main/java/bjc/everge/ReplPair.java
@@ -6,14 +6,21 @@ import java.util.Scanner;
import java.util.function.UnaryOperator;
+import bjc.everge.ControlledString.Control;
+
/**
* String pairs for replacements.
*
* @author Ben Culkin
*/
public class ReplPair implements Comparable<ReplPair>, UnaryOperator<String> {
+ // Line number we read this pair from
private int lno;
+
+ // Stage this pair is in
private int stage;
+
+ // Status of this pair with regards to doing staging stuff
private StageStatus stat = StageStatus.BOTH;
/**
@@ -27,6 +34,7 @@ public class ReplPair implements Comparable<ReplPair>, UnaryOperator<String> {
* Defaults to the 'find' string.
*/
public String name;
+
/**
* The string to look for.
*/
@@ -159,6 +167,21 @@ public class ReplPair implements Comparable<ReplPair>, UnaryOperator<String> {
return readList(detals, scn, errs, new ReplOpts());
}
+ /**
+ * Read a list of replacement pairs from an input source, adding them to
+ * an existing list.
+ *
+ * @param detals
+ * The list to add the replacements to.
+ * @param scn
+ * The source to read the replacements from.
+ * @param errs
+ * The list to stick errors in.
+ * @param ropts
+ * The options to use when reading the pairs.
+ * @return
+ * The list of replacements.
+ */
public static List<ReplPair> readList(List<ReplPair> detals, Scanner scn,
List<ReplError> errs, ReplOpts ropts) {
IntHolder lno = new IntHolder();
@@ -186,9 +209,9 @@ public class ReplPair implements Comparable<ReplPair>, UnaryOperator<String> {
ReplPair rp = new ReplPair();
rp.priority = ropts.defPrior;
- rp.stat = ropts.defStatus;
- rp.lno = lno.get();
- rp.stage = ropts.defStage;
+ rp.stat = ropts.defStatus;
+ rp.lno = lno.get();
+ rp.stage = ropts.defStage;
boolean isMulti = ropts.defMulti;