summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnitsGUI
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-06-04 18:39:03 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-06-04 18:39:03 -0500
commit25f972d198e50ad5a54fa175ec39887f02c33fdc (patch)
tree2807b0ee27a5594f0dfcab421e6840c1270a8e6c /src/main/java/sevenUnitsGUI
parentae0559a9432f85f9147eeb80b35f1b2947889acd (diff)
Remove most comment warnings
In some cases I've used @SuppressWarnings, which Gradle doesn't seem to respect, but I've solved all the other ones.
Diffstat (limited to 'src/main/java/sevenUnitsGUI')
-rw-r--r--src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java2
-rw-r--r--src/main/java/sevenUnitsGUI/GridBagBuilder.java7
-rw-r--r--src/main/java/sevenUnitsGUI/Presenter.java2
-rw-r--r--src/main/java/sevenUnitsGUI/StandardDisplayRules.java2
-rw-r--r--src/main/java/sevenUnitsGUI/ViewBot.java30
5 files changed, 42 insertions, 1 deletions
diff --git a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
index 1fb2709..ccc9f1c 100644
--- a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
+++ b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
@@ -15,12 +15,14 @@ import sevenUnits.unit.UnitPrefix;
* @since 2020-08-26
*/
public enum DefaultPrefixRepetitionRule implements Predicate<List<UnitPrefix>> {
+ /** Prefix repetition is never allowed; only one prefix may be used. */
NO_REPETITION {
@Override
public boolean test(List<UnitPrefix> prefixes) {
return prefixes.size() <= 1;
}
},
+ /** Prefix repetition is always allowed, without restrictions. */
NO_RESTRICTION {
@Override
public boolean test(List<UnitPrefix> prefixes) {
diff --git a/src/main/java/sevenUnitsGUI/GridBagBuilder.java b/src/main/java/sevenUnitsGUI/GridBagBuilder.java
index fdbaee7..95fc094 100644
--- a/src/main/java/sevenUnitsGUI/GridBagBuilder.java
+++ b/src/main/java/sevenUnitsGUI/GridBagBuilder.java
@@ -418,6 +418,7 @@ final class GridBagBuilder {
/**
* @param anchor anchor to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -428,6 +429,7 @@ final class GridBagBuilder {
/**
* @param fill fill to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -438,6 +440,7 @@ final class GridBagBuilder {
/**
* @param insets insets to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -448,6 +451,7 @@ final class GridBagBuilder {
/**
* @param ipadx ipadx to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -458,6 +462,7 @@ final class GridBagBuilder {
/**
* @param ipady ipady to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -468,6 +473,7 @@ final class GridBagBuilder {
/**
* @param weightx weightx to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
@@ -478,6 +484,7 @@ final class GridBagBuilder {
/**
* @param weighty weighty to set
+ * @return this, so that you can chain methods
* @since 2018-11-30
* @since v0.1.0
*/
diff --git a/src/main/java/sevenUnitsGUI/Presenter.java b/src/main/java/sevenUnitsGUI/Presenter.java
index 44261a5..6dce39d 100644
--- a/src/main/java/sevenUnitsGUI/Presenter.java
+++ b/src/main/java/sevenUnitsGUI/Presenter.java
@@ -1280,6 +1280,8 @@ public final class Presenter {
/**
* Sets whether or not the default datafiles will be loaded.
* This method automatically updates the view's units.
+ *
+ * @param useDefaultDatafiles whether or not default datafiles should be loaded
*/
public void setUseDefaultDatafiles(boolean useDefaultDatafiles) {
this.useDefaultDatafiles = useDefaultDatafiles;
diff --git a/src/main/java/sevenUnitsGUI/StandardDisplayRules.java b/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
index d00263b..ff9c64e 100644
--- a/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
+++ b/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
@@ -40,6 +40,7 @@ public final class StandardDisplayRules {
*/
public static final class FixedDecimals
implements Function<UncertainDouble, String> {
+ /** Regular expression used for converting this to a string. */
public static final Pattern TO_STRING_PATTERN = Pattern
.compile("Round to (\\d+) decimal places");
/**
@@ -101,6 +102,7 @@ public final class StandardDisplayRules {
*/
public static final class FixedPrecision
implements Function<UncertainDouble, String> {
+ /** Regular expression used for converting this to a string. */
public static final Pattern TO_STRING_PATTERN = Pattern
.compile("Round to (\\d+) significant figures");
diff --git a/src/main/java/sevenUnitsGUI/ViewBot.java b/src/main/java/sevenUnitsGUI/ViewBot.java
index aea30bb..60a8d7b 100644
--- a/src/main/java/sevenUnitsGUI/ViewBot.java
+++ b/src/main/java/sevenUnitsGUI/ViewBot.java
@@ -79,10 +79,12 @@ public final class ViewBot
return Objects.hash(this.multiplierString, this.nameSymbol);
}
+ /** @return A string representation of the prefix multiplier. */
public String multiplierString() {
return this.multiplierString;
}
+ /** @return A {@code NameSymbol} describing the prefix. */
public NameSymbol nameSymbol() {
return this.nameSymbol;
}
@@ -112,6 +114,10 @@ public final class ViewBot
private final UnitType unitType;
/**
+ * @param nameSymbol name(s) and symbol of unit
+ * @param definition unit's definition string
+ * @param dimensionName name of unit's dimension
+ * @param unitType type of unit (metric/semi-metric/non-metric)
* @since 2022-04-16
*/
public UnitViewingRecord(NameSymbol nameSymbol, String definition,
@@ -166,6 +172,7 @@ public final class ViewBot
this.nameSymbol, this.unitType);
}
+ /** @return name(s) and symbol of unit */
public NameSymbol nameSymbol() {
return this.nameSymbol;
}
@@ -395,6 +402,10 @@ public final class ViewBot
this.selectedDimensionName = selectedDimensionName;
}
+ /**
+ * Sets the view's selected dimension
+ * @param selectedDimensionName name of dimension to select (string)
+ */
public void setSelectedDimensionName(String selectedDimensionName) {
this.setSelectedDimensionName(Optional.of(selectedDimensionName));
}
@@ -412,7 +423,7 @@ public final class ViewBot
}
/**
- * @param toSelection the toSelection to set
+ * @param toSelection unit set in the 'To' selection
* @since 2022-01-29
*/
public void setToSelection(Optional<String> toSelection) {
@@ -420,6 +431,9 @@ public final class ViewBot
"toSelection cannot be null.");
}
+ /**
+ * @param toSelection unit set in the 'To' selection
+ */
public void setToSelection(String toSelection) {
this.setToSelection(Optional.of(toSelection));
}
@@ -439,18 +453,32 @@ public final class ViewBot
// do nothing, ViewBot supports selecting any unit
}
+ /**
+ * @param viewedPrefixName name of prefix being used
+ */
public void setViewedPrefixName(Optional<String> viewedPrefixName) {
this.prefixViewerSelection = viewedPrefixName;
}
+ /**
+ * @param viewedPrefixName name of prefix being used (may not be null)
+ * @throws NullPointerException if {@code viewedPrefixName} is null
+ */
public void setViewedPrefixName(String viewedPrefixName) {
this.setViewedPrefixName(Optional.of(viewedPrefixName));
}
+ /**
+ * @param viewedUnitName name of unit being used
+ */
public void setViewedUnitName(Optional<String> viewedUnitName) {
this.unitViewerSelection = viewedUnitName;
}
+ /**
+ * @param viewedUnitName name of unit being used (may not be null)
+ * @throws NullPointerException if {@code viewedUnitName} is null
+ */
public void setViewedUnitName(String viewedUnitName) {
this.setViewedUnitName(Optional.of(viewedUnitName));
}