From e68d36aafd8a10fa52ad263045c960747e754b5e Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sat, 2 Jun 2018 17:39:54 -0300 Subject: Comment changes Perform various comment tweaks and changes --- .../main/java/bjc/utils/cli/GenericCommandMode.java | 6 ++++-- .../main/java/bjc/utils/data/GeneratingIterator.java | 8 +++++--- .../java/bjc/utils/data/TopDownTransformIterator.java | 1 + base/src/main/java/bjc/utils/data/Tree.java | 2 ++ .../java/bjc/utils/ioutils/RegexStringEditor.java | 2 +- .../java/bjc/utils/ioutils/RuleBasedConfigReader.java | 19 ++++++++++++------- base/src/main/java/bjc/utils/math/CardinalState.java | 4 +++- base/src/main/java/bjc/utils/math/Dual.java | 6 +++--- base/src/main/java/bjc/utils/math/DualExpr.java | 5 +++++ base/src/main/java/bjc/utils/math/NumberUtils.java | 9 ++++++++- 10 files changed, 44 insertions(+), 18 deletions(-) (limited to 'base/src/main/java/bjc') diff --git a/base/src/main/java/bjc/utils/cli/GenericCommandMode.java b/base/src/main/java/bjc/utils/cli/GenericCommandMode.java index 7be5454..03d9feb 100644 --- a/base/src/main/java/bjc/utils/cli/GenericCommandMode.java +++ b/base/src/main/java/bjc/utils/cli/GenericCommandMode.java @@ -144,8 +144,10 @@ public class GenericCommandMode implements CommandMode { /* Default command builders */ /* - * @TODO 10/09/17 Ben Culkin :CommandExtraction These command messages - * should be extracted into some kind of file-based abstraction. + * @TODO 10/09/17 Ben Culkin :CommandExtraction + * + * These command messages should be extracted into some kind of + * file-based abstraction. */ private GenericCommand buildAliasCommand() { final String aliasShortHelp = "alias\tAlias one command to another"; diff --git a/base/src/main/java/bjc/utils/data/GeneratingIterator.java b/base/src/main/java/bjc/utils/data/GeneratingIterator.java index 8e6bcd2..25d2d3d 100644 --- a/base/src/main/java/bjc/utils/data/GeneratingIterator.java +++ b/base/src/main/java/bjc/utils/data/GeneratingIterator.java @@ -45,9 +45,11 @@ public class GeneratingIterator implements Iterator { } /* - * @NOTE As this currently is, it only works correctly assuming that - * next() is only called when hasNext() is true. Should we safeguard - * against people who are not doing the right thing? + * @NOTE + * + * As this currently is, it only works correctly assuming that next() is + * only called when hasNext() is true. Should we safeguard against + * people who are not doing the right thing? */ @Override public E next() { diff --git a/base/src/main/java/bjc/utils/data/TopDownTransformIterator.java b/base/src/main/java/bjc/utils/data/TopDownTransformIterator.java index 9a99a70..f5bc2e6 100644 --- a/base/src/main/java/bjc/utils/data/TopDownTransformIterator.java +++ b/base/src/main/java/bjc/utils/data/TopDownTransformIterator.java @@ -16,6 +16,7 @@ import java.util.function.Function; * Figure out what is broken with this, and fix it so that step-wise * iteration works correctly. */ + /** * An iterative top-down transform of a tree. * diff --git a/base/src/main/java/bjc/utils/data/Tree.java b/base/src/main/java/bjc/utils/data/Tree.java index 77dc390..40ed0f5 100644 --- a/base/src/main/java/bjc/utils/data/Tree.java +++ b/base/src/main/java/bjc/utils/data/Tree.java @@ -29,6 +29,8 @@ public class Tree implements ITree { /* * @NOTE Why have both this boolean and childCount? Why not just do a * childCount == 0 whenever you'd check hasChildren? + * - Because hasChildren is set once and not reset, and really what + * it indicates is that children has been allocated. */ private boolean hasChildren; /* The number of children this node has. */ diff --git a/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java b/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java index 9f81001..6068422 100644 --- a/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java +++ b/base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java @@ -204,7 +204,7 @@ public class RegexStringEditor { } /** - * Apply an operation to a string if it matches a regular expression. + * Apply an operation to a string if it doesn't match a regular expression. * * @param input * The input string. diff --git a/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java b/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java index 9b46c06..3e8851a 100644 --- a/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java +++ b/base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java @@ -27,25 +27,30 @@ import bjc.utils.funcdata.IMap; */ public class RuleBasedConfigReader { /* - * Function to execute when starting a rule. Takes the tokenizer, and a - * pair of the read token and application state + * Function to execute when starting a rule. + * + * Takes the tokenizer, and a pair of the read token and application state */ private BiConsumer> start; /* - * Function to use when continuing a rule Takes a tokenizer and - * application state + * Function to use when continuing a rule. + * + * Takes a tokenizer and application state */ private BiConsumer continueRule; /* - * Function to use when ending a rule Takes an application state + * Function to use when ending a rule. + * + * Takes an application state */ private Consumer end; /* - * Map of pragma names to pragma actions Pragma actions are functions - * taking a tokenizer and application state + * Map of pragma names to pragma actions. + * + * Pragma actions are functions taking a tokenizer and application state */ private final IMap> pragmas; diff --git a/base/src/main/java/bjc/utils/math/CardinalState.java b/base/src/main/java/bjc/utils/math/CardinalState.java index d8990dd..3c97b68 100644 --- a/base/src/main/java/bjc/utils/math/CardinalState.java +++ b/base/src/main/java/bjc/utils/math/CardinalState.java @@ -9,6 +9,8 @@ import java.util.function.LongPredicate; * @TODO 2/12/18 Ben Culkin :AdditionalCardinals * * Add some built-in implementations for various things. + * + * By this, I mean for various unit scales, like custom and metric weights */ /** * Customizations for number cardinalization. @@ -73,4 +75,4 @@ public class CardinalState { return null; } -} \ No newline at end of file +} diff --git a/base/src/main/java/bjc/utils/math/Dual.java b/base/src/main/java/bjc/utils/math/Dual.java index 81c9819..7eea6a9 100644 --- a/base/src/main/java/bjc/utils/math/Dual.java +++ b/base/src/main/java/bjc/utils/math/Dual.java @@ -3,8 +3,8 @@ package bjc.utils.math; /** * Represents a 'dual' number. * - * Think imaginary numbers, where instead of i, we add a value d such that d^2 = - * 0. + * Think imaginary numbers, where instead of i, we add a value d such that + * d^2 = 0. */ public class Dual { /** @@ -75,4 +75,4 @@ public class Dual { if(Double.doubleToLongBits(real) != Double.doubleToLongBits(other.real)) return false; return true; } -} \ No newline at end of file +} diff --git a/base/src/main/java/bjc/utils/math/DualExpr.java b/base/src/main/java/bjc/utils/math/DualExpr.java index 947b00c..9a4ed5e 100644 --- a/base/src/main/java/bjc/utils/math/DualExpr.java +++ b/base/src/main/java/bjc/utils/math/DualExpr.java @@ -1,5 +1,10 @@ package bjc.utils.math; +/* + * @TODO Ben Culkin 6/2/18 :DualOptimize + * + * Write an optimize() method that optimizes dual expressions. + */ /** * Represents an expression using dual numbers. * diff --git a/base/src/main/java/bjc/utils/math/NumberUtils.java b/base/src/main/java/bjc/utils/math/NumberUtils.java index 3c3ca02..53ab211 100644 --- a/base/src/main/java/bjc/utils/math/NumberUtils.java +++ b/base/src/main/java/bjc/utils/math/NumberUtils.java @@ -426,7 +426,14 @@ public class NumberUtils { work.reverse(); - /* @TODO Should we have some way to specify how to pad? */ + /* + * @TODO + * + * Should we have some way to specify how to pad? + * + * By this, I mean specify padding direction (left, right, + * balanced...) + */ StringBuilder pad = new StringBuilder(); if(work.length() < mincols) { -- cgit v1.2.3