From ddfb3e3e504e8b932e8669e36561237632916c58 Mon Sep 17 00:00:00 2001 From: bowring Date: Tue, 8 Dec 2015 11:05:13 -0500 Subject: [PATCH] interface refactoring --- .../org/earthtime/aliquots/ReduxAliquotInterface.java | 10 +++++++++- .../org/earthtime/fractions/ETFractionInterface.java | 4 ++-- .../java/org/earthtime/samples/SampleInterface.java | 1 - 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java b/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java index 36a5359b..fd2d46ce 100644 --- a/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java +++ b/src/main/java/org/earthtime/aliquots/ReduxAliquotInterface.java @@ -15,6 +15,7 @@ */ package org.earthtime.aliquots; +import java.util.Collections; import java.util.Vector; import org.earthtime.fractions.ETFractionInterface; @@ -30,6 +31,13 @@ public interface ReduxAliquotInterface { public Vector getAliquotFractions(); + public default Vector getAliquotFractionsSorted() { + if (getAliquotFractions() != null) { + Collections.sort(getAliquotFractions(), ETFractionInterface.FRACTION_ID_ORDER); + } + return getAliquotFractions(); + } + public void setAliquotFractions(Vector aliquotFractions); public boolean isCompiled(); @@ -114,6 +122,6 @@ public default Vector getAliquotSampleDateModelDeSelectedFr return retVal; } - + public void reduceData(); } diff --git a/src/main/java/org/earthtime/fractions/ETFractionInterface.java b/src/main/java/org/earthtime/fractions/ETFractionInterface.java index 600251bf..558930d9 100644 --- a/src/main/java/org/earthtime/fractions/ETFractionInterface.java +++ b/src/main/java/org/earthtime/fractions/ETFractionInterface.java @@ -375,8 +375,8 @@ public default ValueModel getRadiogenicIsotopeRatioByName(String ratioName) { ValueModel rirModel = new ValueModel(ratioName.trim(), ratioName.startsWith("rho") ?// - new BigDecimal(ReduxConstants.NO_RHO_FLAG, ReduxConstants.mathContext15) // - : BigDecimal.ZERO,// June 2010 to force out of range of legal cov [-1,,,1]0.0; + new BigDecimal(ReduxConstants.NO_RHO_FLAG, ReduxConstants.mathContext15) // + : BigDecimal.ZERO,// June 2010 to force out of range of legal cov [-1,,,1]0.0; "ABS", BigDecimal.ZERO, BigDecimal.ZERO); diff --git a/src/main/java/org/earthtime/samples/SampleInterface.java b/src/main/java/org/earthtime/samples/SampleInterface.java index 6644af21..64b5d24b 100644 --- a/src/main/java/org/earthtime/samples/SampleInterface.java +++ b/src/main/java/org/earthtime/samples/SampleInterface.java @@ -569,7 +569,6 @@ public default AliquotInterface getAliquotByNumber(int aliquotNum) { } ((ReduxAliquotInterface) retAliquot).setAliquotFractions(retFractions); -//// retAliquot.setMyReduxLabData(ReduxLabData.getInstance()); return retAliquot; }