Removed not used bigint value

This commit is contained in:
Willem Cazander 2022-10-14 01:36:17 +02:00
parent 2e29efb5fe
commit 71055614f4
2 changed files with 5 additions and 13 deletions

View file

@ -23,7 +23,6 @@
package net.forwardfire.unitxc.converter; package net.forwardfire.unitxc.converter;
import java.math.BigDecimal;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
@ -74,10 +73,6 @@ public class UnitXConverter {
} }
public UnitXConverterResult convertStepped(double value, UnitXCType fromType, UnitXCType toType, Map<String,UnitXConverterParameterValue> parameters) { public UnitXConverterResult convertStepped(double value, UnitXCType fromType, UnitXCType toType, Map<String,UnitXConverterParameterValue> parameters) {
return convertStepped(BigDecimal.valueOf(value), fromType, toType, parameters);
}
public UnitXConverterResult convertStepped(BigDecimal value, UnitXCType fromType, UnitXCType toType, Map<String,UnitXConverterParameterValue> parameters) {
return convertEngine.convertStepped(value, fromType, toType, parameters); return convertEngine.convertStepped(value, fromType, toType, parameters);
} }
} }

View file

@ -23,7 +23,6 @@
package net.forwardfire.unitxc.converter; package net.forwardfire.unitxc.converter;
import java.math.BigDecimal;
import java.math.MathContext; import java.math.MathContext;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -31,8 +30,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.forwardfire.unitxc.UnitXCManager; import net.forwardfire.unitxc.UnitXCManager;
import net.forwardfire.unitxc.model.DefaultUnitXConverterResult; import net.forwardfire.unitxc.model.DefaultUnitXConverterResult;
@ -58,7 +55,7 @@ import net.forwardfire.unitxc.model.step.value.UnitXConverterStepValueReferenceD
*/ */
public final class UnitXConverterEngine { public final class UnitXConverterEngine {
private final static Logger LOG = LoggerFactory.getLogger(UnitXConverterEngine.class); //private final static Logger LOG = LoggerFactory.getLogger(UnitXConverterEngine.class);
private final UnitXCManager manager; private final UnitXCManager manager;
private final UnitXConverterStep roundingStep; private final UnitXConverterStep roundingStep;
@ -67,8 +64,8 @@ public final class UnitXConverterEngine {
this.roundingStep = new UnitXCConverterStepAutoRounding(UnitXConverterStepContext.createStepValue(),UnitXConverterStepContext.createStepValue()); this.roundingStep = new UnitXCConverterStepAutoRounding(UnitXConverterStepContext.createStepValue(),UnitXConverterStepContext.createStepValue());
} }
public UnitXConverterResult convertStepped(BigDecimal valueConvert2,UnitXCType fromType,UnitXCType toType, Map<String,UnitXConverterParameterValue> parameters) { public UnitXConverterResult convertStepped(double valueConvert,UnitXCType fromType,UnitXCType toType, Map<String,UnitXConverterParameterValue> parameters) {
Validate.notNull(valueConvert2,"Can't convert null to number"); Validate.notNull(valueConvert,"Can't convert null to number");
Validate.notNull(fromType,"Can't convert from null unit type"); Validate.notNull(fromType,"Can't convert from null unit type");
Validate.notNull(toType,"Can't convert to null unit type"); Validate.notNull(toType,"Can't convert to null unit type");
@ -80,7 +77,7 @@ public final class UnitXConverterEngine {
toType = Validate.notNull(manager.getUnitType(toType.getAliasOfType()),"Coultn't resolve alias id: "+toType.getAliasOfType()+" for: "+toType.getId()); toType = Validate.notNull(manager.getUnitType(toType.getAliasOfType()),"Coultn't resolve alias id: "+toType.getAliasOfType()+" for: "+toType.getId());
} }
double valueConvert = valueConvert2.doubleValue(); //double valueConvert = valueConvert2.doubleValue();
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
MathContext mathContext = MathContext.DECIMAL128; MathContext mathContext = MathContext.DECIMAL128;
UnitXConverterStepContextImpl ctx = new UnitXConverterStepContextImpl(mathContext,valueConvert); UnitXConverterStepContextImpl ctx = new UnitXConverterStepContextImpl(mathContext,valueConvert);
@ -114,7 +111,7 @@ public final class UnitXConverterEngine {
double paraValue = convPara.getValue(); double paraValue = convPara.getValue();
if (!paraToBase) { if (!paraToBase) {
System.out.println("--- cont para");; System.out.println("--- cont para");;
UnitXConverterResult res = convertStepped(BigDecimal.valueOf(paraValue), convPara.getValueType(), manager.getUnitType(convPara.getValueType().getUnitGroup().getBaseTypeId()), parameters); // FIXME rm parameters ? UnitXConverterResult res = convertStepped(paraValue, convPara.getValueType(), manager.getUnitType(convPara.getValueType().getUnitGroup().getBaseTypeId()), parameters); // FIXME rm parameters ?
paraValue = res.getResultValue(); paraValue = res.getResultValue();
//ctx.resultSteps.addAll(res.getResultSteps()); //ctx.resultSteps.addAll(res.getResultSteps());
} }