From da740edd3972fa049c4c8d0e43448c10a6a65dce Mon Sep 17 00:00:00 2001
From: Adrien Hopkins > {
final boolean magnifying;
if (prefixes.isEmpty())
return true;
- else if (prefixes.get(0).getMultiplier() > 1) {
+ if (prefixes.get(0).getMultiplier() > 1) {
magnifying = true;
} else {
magnifying = false;
@@ -68,15 +68,13 @@ public enum DefaultPrefixRepetitionRule implements Predicate
> {
if (!Metric.DECIMAL_PREFIXES.contains(prefixes.get(0)))
return NO_REPETITION.test(prefixes);
- int part = 0; // 0=yotta/yoctos, 1=kilo-zetta/milli-zepto,
+ var part = 0; // 0=yotta/yoctos, 1=kilo-zetta/milli-zepto,
// 2=deka,hecto,deci,centi
for (final UnitPrefix prefix : prefixes) {
// check that the current prefix is metric and appropriately
// magnifying/reducing
- if (!Metric.DECIMAL_PREFIXES.contains(prefix))
- return false;
- if (magnifying != prefix.getMultiplier() > 1)
+ if (!Metric.DECIMAL_PREFIXES.contains(prefix) || (magnifying != prefix.getMultiplier() > 1))
return false;
// check if the current prefix is correct
diff --git a/src/main/java/sevenUnitsGUI/DelegateListModel.java b/src/main/java/sevenUnitsGUI/DelegateListModel.java
index 200eee2..da4f978 100644
--- a/src/main/java/sevenUnitsGUI/DelegateListModel.java
+++ b/src/main/java/sevenUnitsGUI/DelegateListModel.java
@@ -31,7 +31,7 @@ import javax.swing.AbstractListModel;
* the delegated list's methods because the delegate methods handle updating the
* list.
*
* The default value is RELATIVE
. gridx
should be a
* non-negative value.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#gridy
@@ -58,7 +58,7 @@ final class GridBagBuilder {
*
* The default value is RELATIVE
. gridy
should be a
* non-negative value.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#gridx
@@ -76,7 +76,7 @@ final class GridBagBuilder {
* from gridx
to the next to the last one in its row.
*
* gridwidth
should be non-negative and the default value is 1.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#gridheight
@@ -96,7 +96,7 @@ final class GridBagBuilder {
*
* gridheight
should be a non-negative value and the default
* value is 1.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#gridwidth
@@ -119,7 +119,7 @@ final class GridBagBuilder {
*
* The default value of this field is 0
. weightx
* should be a non-negative value.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#weighty
@@ -142,7 +142,7 @@ final class GridBagBuilder {
*
* The default value of this field is 0
. weighty
* should be a non-negative value.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#weightx
@@ -173,7 +173,7 @@ final class GridBagBuilder {
* BELOW_BASELINE
, BELOW_BASELINE_LEADING
, and
* BELOW_BASELINE_TRAILING
. The default value is
* CENTER
.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.ComponentOrientation
@@ -199,7 +199,7 @@ final class GridBagBuilder {
*
*
* The default value is NONE
.
- *
+ *
* @serial
* @see #clone()
*/
@@ -212,7 +212,7 @@ final class GridBagBuilder {
* amount of space between the component and the edges of its display area.
*
* The default value is new Insets(0, 0, 0, 0)
.
- *
+ *
* @serial
* @see #clone()
*/
@@ -226,7 +226,7 @@ final class GridBagBuilder {
* is at least its minimum width plus ipadx
pixels.
*
* The default value is 0
.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#ipady
@@ -241,7 +241,7 @@ final class GridBagBuilder {
* least its minimum height plus ipady
pixels.
*
* The default value is 0.
- *
+ *
* @serial
* @see #clone()
* @see java.awt.GridBagConstraints#ipadx
@@ -292,7 +292,6 @@ final class GridBagBuilder {
final int gridheight, final double weightx, final double weighty,
final int anchor, final int fill, final Insets insets, final int ipadx,
final int ipady) {
- super();
this.gridx = gridx;
this.gridy = gridy;
this.gridwidth = gridwidth;
diff --git a/src/main/java/sevenUnitsGUI/PrefixSearchRule.java b/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
index 2ea0923..73d12bc 100644
--- a/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
+++ b/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
@@ -73,7 +73,7 @@ public final class PrefixSearchRule implements
* @since 2022-07-06
* @since v0.4.0
*/
- public static final PrefixSearchRule getCoherentOnlyRule(
+ public static PrefixSearchRule getCoherentOnlyRule(
Set
* Reapplies the search filter, and custom filters.
* > prefixRepetitionRule = DefaultPrefixRepetitionRule.NO_RESTRICTION;
-
+
/**
* A rule that accepts a prefixless name-unit pair and returns a map mapping
* names to prefixed versions of that unit (including the unit itself) that
* should be searchable.
*/
private Function
> getPrefixRepetitionRule() {
return this.prefixRepetitionRule;
}
-
+
/**
* @return the rule that determines which units are prefixed
* @since 2022-07-08
@@ -863,7 +854,7 @@ public final class Presenter {
public Function