Skip to content
Snippets Groups Projects
Commit 508139e2 authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

calc config builder javadoc

parent fe4cc9ca
No related branches found
No related tags found
1 merge request!58Implemented gmm additional epistemic uncertainty
...@@ -317,6 +317,9 @@ public final class CalcConfig { ...@@ -317,6 +317,9 @@ public final class CalcConfig {
private DeaggData deagg; private DeaggData deagg;
private SiteSet sites; private SiteSet sites;
/**
* Initialize a new builder with a copy of that supplied.
*/
public Builder copy(CalcConfig config) { public Builder copy(CalcConfig config) {
checkNotNull(config); checkNotNull(config);
this.resource = config.resource; this.resource = config.resource;
...@@ -332,6 +335,9 @@ public final class CalcConfig { ...@@ -332,6 +335,9 @@ public final class CalcConfig {
return this; return this;
} }
/**
* Initialize a new builder with defaults.
*/
public Builder withDefaults() { public Builder withDefaults() {
this.exceedanceModel = ExceedanceModel.TRUNCATION_UPPER_ONLY; this.exceedanceModel = ExceedanceModel.TRUNCATION_UPPER_ONLY;
this.truncationLevel = 3.0; this.truncationLevel = 3.0;
...@@ -348,6 +354,10 @@ public final class CalcConfig { ...@@ -348,6 +354,10 @@ public final class CalcConfig {
return this; return this;
} }
/**
* Extend {@code this} builder to match {@code that} builder. Fields in
* that builder take precedence unless they are not set.
*/
public Builder extend(final Builder that) { public Builder extend(final Builder that) {
checkNotNull(that); checkNotNull(that);
if (that.resource != null) this.resource = that.resource; if (that.resource != null) this.resource = that.resource;
...@@ -363,6 +373,9 @@ public final class CalcConfig { ...@@ -363,6 +373,9 @@ public final class CalcConfig {
return this; return this;
} }
/**
* Set the IMTs for which results should be calculated.
*/
public Builder imts(Set<Imt> imts) { public Builder imts(Set<Imt> imts) {
this.imts = checkNotNull(imts); this.imts = checkNotNull(imts);
return this; return this;
...@@ -409,6 +422,9 @@ public final class CalcConfig { ...@@ -409,6 +422,9 @@ public final class CalcConfig {
built = true; built = true;
} }
/**
* Build a new calculation configuration.
*/
public CalcConfig build() { public CalcConfig build() {
validateState(ID); validateState(ID);
Set<Imt> finalImts = Sets.immutableEnumSet(imts); Set<Imt> finalImts = Sets.immutableEnumSet(imts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment