diff --git a/src/org/opensha2/calc/CalcConfig.java b/src/org/opensha2/calc/CalcConfig.java index 6c6fcc682378c074a13c88be9260c499a0556a9a..0eb80754618128cade12a5d9ca21d61bcf98610c 100644 --- a/src/org/opensha2/calc/CalcConfig.java +++ b/src/org/opensha2/calc/CalcConfig.java @@ -694,9 +694,9 @@ public final class CalcConfig { /** * The rate data distribution type. * - * <p><b>Default:</b> {@link Distribution#INCREMENTAL} + * <p><b>Default:</b> {@link DistributionFormat#INCREMENTAL} */ - public final Distribution distribution; + public final DistributionFormat distributionFormat; /** * The value format for rate data. @@ -715,13 +715,13 @@ public final class CalcConfig { private Rate( Bins bins, double distance, - Distribution distribution, + DistributionFormat distributionFormat, ValueFormat valueFormat, double timespan) { this.bins = bins; this.distance = distance; - this.distribution = distribution; + this.distributionFormat = distributionFormat; this.valueFormat = valueFormat; this.timespan = timespan; } @@ -734,7 +734,7 @@ public final class CalcConfig { .append("max=").append(bins.mMax).append(", ") .append("Δ=").append(bins.Δm) .append(formatEntry(Key.DISTANCE, distance)) - .append(formatEntry(Key.DISTRIBUTION, distribution.name())) + .append(formatEntry(Key.DISTRIBUTION, distributionFormat.name())) .append(formatEntry(Key.VALUE_FORMAT, valueFormat.name())) .append(formatEntry(Key.TIMESPAN, timespan)); } @@ -743,7 +743,7 @@ public final class CalcConfig { Bins bins; Double distance; - Distribution distribution; + DistributionFormat distributionFormat; ValueFormat valueFormat; Double timespan; @@ -751,7 +751,7 @@ public final class CalcConfig { return new Rate( bins, distance, - distribution, + distributionFormat, valueFormat, timespan); } @@ -759,7 +759,7 @@ public final class CalcConfig { void copy(Rate that) { this.bins = that.bins; this.distance = that.distance; - this.distribution = that.distribution; + this.distributionFormat = that.distributionFormat; this.valueFormat = that.valueFormat; this.timespan = that.timespan; } @@ -771,8 +771,8 @@ public final class CalcConfig { if (that.distance != null) { this.distance = that.distance; } - if (that.distribution != null) { - this.distribution = that.distribution; + if (that.distributionFormat != null) { + this.distributionFormat = that.distributionFormat; } if (that.valueFormat != null) { this.valueFormat = that.valueFormat; @@ -786,7 +786,7 @@ public final class CalcConfig { Builder b = new Builder(); b.bins = Bins.defaults(); b.distance = 20.0; - b.distribution = Distribution.INCREMENTAL; + b.distributionFormat = DistributionFormat.INCREMENTAL; b.valueFormat = ValueFormat.ANNUAL_RATE; b.timespan = 30.0; return b; @@ -798,7 +798,7 @@ public final class CalcConfig { checkNotNull(bins.mMax, STATE_ERROR, Rate.ID, Key.BINS + ".mMax"); checkNotNull(bins.Δm, STATE_ERROR, Rate.ID, Key.BINS + ".Δm"); checkNotNull(distance, STATE_ERROR, Rate.ID, Key.DISTANCE); - checkNotNull(distribution, STATE_ERROR, Rate.ID, Key.DISTRIBUTION); + checkNotNull(distributionFormat, STATE_ERROR, Rate.ID, Key.DISTRIBUTION); checkNotNull(valueFormat, STATE_ERROR, Rate.ID, Key.VALUE_FORMAT); checkNotNull(timespan, STATE_ERROR, Rate.ID, Key.TIMESPAN); } diff --git a/src/org/opensha2/calc/Distribution.java b/src/org/opensha2/calc/DistributionFormat.java similarity index 66% rename from src/org/opensha2/calc/Distribution.java rename to src/org/opensha2/calc/DistributionFormat.java index bbc994650cb1bd1019e21867a804719d12b6dd29..9c61b59db05c8345be8711238cea5b5e00edab35 100644 --- a/src/org/opensha2/calc/Distribution.java +++ b/src/org/opensha2/calc/DistributionFormat.java @@ -5,7 +5,8 @@ package org.opensha2.calc; * * @author Peter Powers */ -public enum Distribution { +@SuppressWarnings("javadoc") +public enum DistributionFormat { INCREMENTAL, CUMULATIVE; diff --git a/src/org/opensha2/calc/EqRate.java b/src/org/opensha2/calc/EqRate.java index fa3d7bf2f43964eae00d9e771a5bc3ef0660ffab..9149d8ef41974b9efe2ff09ef440bf8c8a9adddc 100644 --- a/src/org/opensha2/calc/EqRate.java +++ b/src/org/opensha2/calc/EqRate.java @@ -78,7 +78,7 @@ public class EqRate { .build(); EqRate rates = createIncremental(model, site, rateConfig.distance, modelMfd); - if (rateConfig.distribution == Distribution.CUMULATIVE) { + if (rateConfig.distributionFormat == DistributionFormat.CUMULATIVE) { rates = toCumulative(rates); } if (rateConfig.valueFormat == ValueFormat.POISSON_PROBABILITY) { @@ -189,7 +189,7 @@ public class EqRate { * <p><b>NOTE:</b> This operation is additive and will produce meaningless * results if {@code rates} have already been converted to * {@link #toPoissonProbability(EqRate, double) probabilities}, or are not all - * of {@link Distribution#INCREMENTAL} or {@link Distribution#CUMULATIVE} + * of {@link DistributionFormat#INCREMENTAL} or {@link DistributionFormat#CUMULATIVE} * distribution format. * * <p>Buyer beware.