summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/bjc/utils')
-rw-r--r--base/src/main/java/bjc/utils/cli/GenericCommandMode.java6
-rw-r--r--base/src/main/java/bjc/utils/data/GeneratingIterator.java8
-rw-r--r--base/src/main/java/bjc/utils/data/TopDownTransformIterator.java1
-rw-r--r--base/src/main/java/bjc/utils/data/Tree.java2
-rw-r--r--base/src/main/java/bjc/utils/ioutils/RegexStringEditor.java2
-rw-r--r--base/src/main/java/bjc/utils/ioutils/RuleBasedConfigReader.java19
-rw-r--r--base/src/main/java/bjc/utils/math/CardinalState.java4
-rw-r--r--base/src/main/java/bjc/utils/math/Dual.java6
-rw-r--r--base/src/main/java/bjc/utils/math/DualExpr.java5
-rw-r--r--base/src/main/java/bjc/utils/math/NumberUtils.java9
10 files changed, 44 insertions, 18 deletions
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<E> implements Iterator<E> {
}
/*
- * @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<ContainedType> implements ITree<ContainedType> {
/*
* @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<E> {
/*
- * 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<FunctionalStringTokenizer, IPair<String, E>> 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<FunctionalStringTokenizer, E> 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<E> 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<String, BiConsumer<FunctionalStringTokenizer, E>> 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) {