diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCFactory.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCFactory.java index edc026f..94cb3c7 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCFactory.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCFactory.java @@ -40,6 +40,12 @@ import net.forwardfire.unitxc.module.UnitXCModuleTemperature; import net.forwardfire.unitxc.module.UnitXCModuleTime; import net.forwardfire.unitxc.module.UnitXCModuleVolume; +/** + * The unit cross converter factory to create the manager. + * + * @author Willem Cazander + * @version 1.0 Oct 9, 2015 + */ public final class UnitXCFactory { private static final List DEFAULT_CONFIG_MODULES = Collections.unmodifiableList(Arrays.asList( diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCManager.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCManager.java index f0fad75..f8b3681 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCManager.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/UnitXCManager.java @@ -29,14 +29,26 @@ import net.forwardfire.unitxc.converter.UnitXConverter; import net.forwardfire.unitxc.model.UnitXCType; import net.forwardfire.unitxc.model.UnitXCGroup; +/** + * The unit manager which holds all units/groups and provides access to the converter. + * + * @author Willem Cazander + * @version 1.0 Oct 9, 2015 + */ public interface UnitXCManager { + /** + * @return Returns all unit types. + */ Collection getUnitTypes(); UnitXCType getUnitType(String id); boolean isUnitType(String id); - + + /** + * @return Returns all unit groups. + */ Collection getUnitGroups(); UnitXCGroup getUnitGroup(String id); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfig.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfig.java index d0cbf45..14cc799 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfig.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfig.java @@ -32,6 +32,12 @@ import org.apache.commons.lang3.Validate; import net.forwardfire.unitxc.model.UnitXCTypeModel; import net.forwardfire.unitxc.model.UnitXCGroupModel; +/** + * Config to build unit types and groups. + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public final class UnitXCConfig { private final Map unitTypes; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigManager.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigManager.java index db8fa93..ea31e22 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigManager.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigManager.java @@ -39,6 +39,12 @@ import net.forwardfire.unitxc.model.UnitXCType; import net.forwardfire.unitxc.model.UnitXCGroup; import net.forwardfire.unitxc.model.UnitXConverterResult; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCConfigManager implements UnitXCManager { private final UnitXCConfig config; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigModule.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigModule.java index a3c8097..eee30f4 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigModule.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/UnitXCConfigModule.java @@ -28,6 +28,12 @@ import java.util.List; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; +/** + * Config module to build groups and types. + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public interface UnitXCConfigModule { void configModule(UnitXCConfigBuilder config); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCBuilder.java index 875e6bc..3f33e52 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCBuilder.java @@ -36,7 +36,7 @@ import org.apache.commons.lang3.builder.Builder; * @param The object to build. * @param This builder. * @author Willem Cazander - * @version 1.0 May 29, 2015 + * @version 1.0 Oct 22, 2015 */ public abstract class AbstractUnitXCBuilder implements Builder

{ diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCTypeBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCTypeBuilder.java index 66cfdc5..1885729 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCTypeBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/AbstractUnitXCTypeBuilder.java @@ -31,6 +31,12 @@ import java.util.function.BiConsumer; import net.forwardfire.unitxc.converter.step.UnitXConverterStep; import net.forwardfire.unitxc.model.UnitXCTypeModel; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public abstract class AbstractUnitXCTypeBuilder extends AbstractUnitXCBuilder { public AbstractUnitXCTypeBuilder(P parent,BiConsumer parentBuilder) { diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigBuilder.java index 749262a..1f9a17d 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigBuilder.java @@ -27,6 +27,12 @@ import org.apache.commons.lang3.Validate; import net.forwardfire.unitxc.config.UnitXCConfig; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCConfigBuilder { public static final String TYPE_FLAG_IMPERIAL = "IMPERIAL"; // todo move to ... diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigModuleBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigModuleBuilder.java index c2e8a9f..458dfe0 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigModuleBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCConfigModuleBuilder.java @@ -28,6 +28,12 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 31, 2015 + */ public class UnitXCConfigModuleBuilder { } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupBuilder.java index c529238..bd9fd25 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupBuilder.java @@ -26,6 +26,12 @@ package net.forwardfire.unitxc.config.builder; import net.forwardfire.unitxc.model.UnitXCGroupModel; import net.forwardfire.unitxc.model.UnitXCGroupType; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public class UnitXCGroupBuilder extends AbstractUnitXCBuilder { public UnitXCGroupBuilder(UnitXCConfigBuilder parent) { diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCNumberTypeSetting.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCNumberTypeSetting.java index cf3fc0b..c1f278b 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCNumberTypeSetting.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCNumberTypeSetting.java @@ -1,5 +1,11 @@ package net.forwardfire.unitxc.config.builder; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 28, 2015 + */ public class UnitXCNumberTypeSetting { private static final char ZERO_CHAR_NORMAL = '0'; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeBuilder.java index ec2170e..013cf49 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeBuilder.java @@ -27,6 +27,12 @@ import java.util.function.BiConsumer; import net.forwardfire.unitxc.model.UnitXCTypeModel; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 23, 2015 + */ public class UnitXCTypeBuilder

extends AbstractUnitXCTypeBuilder> { public UnitXCTypeBuilder(P parent, BiConsumer parentBuilder) { diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeCompoundExponentBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeCompoundExponentBuilder.java index 50a1dd0..df4d1a3 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeCompoundExponentBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeCompoundExponentBuilder.java @@ -32,6 +32,12 @@ import net.forwardfire.unitxc.converter.step.UnitXConverterStep; import net.forwardfire.unitxc.model.UnitXCGroupModel; import net.forwardfire.unitxc.model.UnitXCTypeModel; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 26, 2015 + */ public class UnitXCTypeCompoundExponentBuilder extends AbstractUnitXCBuilder { private final UnitXCConfigBuilder builder; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefix.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefix.java index ea864a4..b9e131b 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefix.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefix.java @@ -28,6 +28,12 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public enum UnitXCTypeSIPrefix { YOTTA ("Y", 24), diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefixBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefixBuilder.java index a1e00fa..cc28f31 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefixBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCTypeSIPrefixBuilder.java @@ -31,6 +31,12 @@ import java.util.List; import net.forwardfire.unitxc.converter.step.UnitXCTypePowerOfTenConverterStep; import net.forwardfire.unitxc.model.UnitXCTypeModel; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public class UnitXCTypeSIPrefixBuilder

extends AbstractUnitXCTypeBuilder> { private final UnitXCConfigBuilder builder; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXConverterStepBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXConverterStepBuilder.java index e4660a9..8215f27 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXConverterStepBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXConverterStepBuilder.java @@ -37,6 +37,12 @@ import net.forwardfire.unitxc.converter.step.UnitXCTypeOffsetConverterStep; import net.forwardfire.unitxc.converter.step.UnitXCTypePowerConverterStep; import net.forwardfire.unitxc.converter.step.UnitXConverterStep; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 23, 2015 + */ public class UnitXConverterStepBuilder

> extends AbstractUnitXCBuilder,UnitXConverterStepBuilder

> { public UnitXConverterStepBuilder(P parent, BiConsumer> parentBuilder) { diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java index 51c3b43..9f894b5 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverter.java @@ -26,6 +26,12 @@ package net.forwardfire.unitxc.converter; import net.forwardfire.unitxc.model.UnitXCType; import net.forwardfire.unitxc.model.UnitXConverterResult; +/** + * Converts value to value. + * + * @author Willem Cazander + * @version 1.0 Oct 8, 2015 + */ public interface UnitXConverter { double convert(double value,String fromTypeId,String toTypeId); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java index 492759e..ac2ac32 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java @@ -39,6 +39,12 @@ import net.forwardfire.unitxc.model.UnitXConverterResultModel; import net.forwardfire.unitxc.model.UnitXConverterResultStep; import net.forwardfire.unitxc.model.UnitXConverterResultStepModel; +/** + * Runs requested convert steps and builds result models. + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public final class UnitXConverterEngine { private final static Logger LOG = LoggerFactory.getLogger(UnitXConverterEngine.class); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/AbstractUnitXConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/AbstractUnitXConverterStep.java index 1810cee..8d3f825 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/AbstractUnitXConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/AbstractUnitXConverterStep.java @@ -28,6 +28,12 @@ import java.util.List; import org.apache.commons.lang3.Validate; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public abstract class AbstractUnitXConverterStep implements UnitXConverterStep { private final String name; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeDevideConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeDevideConverterStep.java index e080bd1..8309055 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeDevideConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeDevideConverterStep.java @@ -25,6 +25,12 @@ package net.forwardfire.unitxc.converter.step; import org.apache.commons.lang3.Validate; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 20, 2015 + */ public class UnitXCTypeDevideConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "Devide"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyConverterStep.java index c34296f..19cdd53 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyConverterStep.java @@ -23,6 +23,12 @@ package net.forwardfire.unitxc.converter.step; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCTypeMultiplyConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "Multiply"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyFractionConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyFractionConverterStep.java index 49df728..f2f8573 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyFractionConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeMultiplyFractionConverterStep.java @@ -26,6 +26,12 @@ package net.forwardfire.unitxc.converter.step; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.math.Fraction; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 20, 2015 + */ public class UnitXCTypeMultiplyFractionConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "MultiplyFaction"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeOffsetConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeOffsetConverterStep.java index dafba2a..711b3ba 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeOffsetConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypeOffsetConverterStep.java @@ -23,6 +23,12 @@ package net.forwardfire.unitxc.converter.step; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCTypeOffsetConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "Offset"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerConverterStep.java index 581c97d..08b86a3 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerConverterStep.java @@ -23,6 +23,12 @@ package net.forwardfire.unitxc.converter.step; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 26, 2015 + */ public class UnitXCTypePowerConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "power"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerOfTenConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerOfTenConverterStep.java index b229956..fe174e0 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerOfTenConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXCTypePowerOfTenConverterStep.java @@ -23,6 +23,12 @@ package net.forwardfire.unitxc.converter.step; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCTypePowerOfTenConverterStep extends AbstractUnitXConverterStep { private final static String STEP_NAME = "power(10)"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXConverterStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXConverterStep.java index 355d8c9..b3a2098 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXConverterStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/step/UnitXConverterStep.java @@ -25,6 +25,12 @@ package net.forwardfire.unitxc.converter.step; import java.util.List; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 10, 2015 + */ public interface UnitXConverterStep { String getStepName(); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroup.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroup.java index 61ac32c..69c42d2 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroup.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroup.java @@ -25,12 +25,27 @@ package net.forwardfire.unitxc.model; import java.util.Collection; +/** + * The unit group. + * + * @author Willem Cazander + * @version 1.0 Oct 10, 2015 + */ public interface UnitXCGroup { - + + /** + * @return The unit group id. + */ String getId(); + /** + * @return The unit group name. + */ String getName(); + /** + * @return The unit group description. + */ String getDescription(); UnitXCGroupType getType(); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupModel.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupModel.java index f3a210b..2eb009a 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupModel.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupModel.java @@ -29,6 +29,12 @@ import java.util.List; import org.apache.commons.lang3.Validate; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCGroupModel implements UnitXCGroup { private String id; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupType.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupType.java index 43d67f1..fb25f72 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupType.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupType.java @@ -1,5 +1,11 @@ package net.forwardfire.unitxc.model; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 26, 2015 + */ public enum UnitXCGroupType { SI_BASE, diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCType.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCType.java index 9bfeec5..ace2a35 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCType.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCType.java @@ -25,15 +25,30 @@ package net.forwardfire.unitxc.model; import java.util.Collection; +/** + * The unit type. + * + * @author Willem Cazander + * @version 1.0 Oct 10, 2015 + */ public interface UnitXCType { + /** + * @return The unit type id. + */ String getId(); + /** + * @return The unit type name. + */ String getName(); Collection getNameAliases(); String getUnitGroupId(); + /** + * @return The unit type flags. + */ Collection getTypeFlags(); } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCTypeModel.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCTypeModel.java index 0a30b8a..8cf1640 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCTypeModel.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCTypeModel.java @@ -31,6 +31,12 @@ import org.apache.commons.lang3.Validate; import net.forwardfire.unitxc.converter.step.UnitXConverterStep; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCTypeModel implements UnitXCType { private String id; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java index 7134852..2d5705a 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java @@ -25,17 +25,41 @@ package net.forwardfire.unitxc.model; import java.util.List; +/** + * Holds the convert result and meta steps how we got there. + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public interface UnitXConverterResult { + /** + * @return The start value. + */ Double getStartValue(); - UnitXCType getStartType(); + /** + * @return The start value type. + */ + UnitXCType getStartValueType(); + /** + * @return The result value. + */ Double getResultValue(); - UnitXCType getResultType(); + /** + * @return The result value type. + */ + UnitXCType getResultValueType(); + /** + * @return The convert steps performed to get to result value. + */ List getSteps(); + /** + * @return The convert time in ms. + */ Long getConvertTime(); } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultModel.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultModel.java index 0427f07..abf6eb8 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultModel.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultModel.java @@ -27,22 +27,28 @@ import java.util.List; import org.apache.commons.lang3.Validate; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public class UnitXConverterResultModel implements UnitXConverterResult { private final Double startValue; private final List resultSteps; private final Double resultValue; private final Long convertTime; - private final UnitXCType startType; - private final UnitXCType resultType; + private final UnitXCType startValueType; + private final UnitXCType resultValueType; - public UnitXConverterResultModel(Double startValue,Double resultValue,List resultSteps,Long convertTime,UnitXCType startType,UnitXCType resultType) { + public UnitXConverterResultModel(Double startValue,Double resultValue,List resultSteps,Long convertTime,UnitXCType startValueType,UnitXCType resultValueType) { this.startValue = Validate.notNull(startValue); this.resultSteps = Validate.noNullElements(resultSteps); this.resultValue = Validate.notNull(resultValue); this.convertTime = convertTime; - this.startType = Validate.notNull(startType); - this.resultType = Validate.notNull(resultType); + this.startValueType = Validate.notNull(startValueType); + this.resultValueType = Validate.notNull(resultValueType); } @Override @@ -66,12 +72,12 @@ public class UnitXConverterResultModel implements UnitXConverterResult { } @Override - public UnitXCType getStartType() { - return startType; + public UnitXCType getStartValueType() { + return startValueType; } @Override - public UnitXCType getResultType() { - return resultType; + public UnitXCType getResultValueType() { + return resultValueType; } } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java index 40b3806..0e140e1 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java @@ -23,6 +23,12 @@ package net.forwardfire.unitxc.model; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public interface UnitXConverterResultStep { String getName(); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStepModel.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStepModel.java index abd4b57..539f174 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStepModel.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStepModel.java @@ -25,6 +25,12 @@ package net.forwardfire.unitxc.model; import org.apache.commons.lang3.Validate; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 22, 2015 + */ public class UnitXConverterResultStepModel implements UnitXConverterResultStep { private final String name; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleAmountOfSubstance.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleAmountOfSubstance.java index 6ae206d..89d5039 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleAmountOfSubstance.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleAmountOfSubstance.java @@ -30,6 +30,12 @@ import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; import net.forwardfire.unitxc.config.builder.UnitXCTypeSIPrefix; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 23, 2015 + */ public class UnitXCModuleAmountOfSubstance implements UnitXCConfigModule { public static final String GROUP_ID = "substance"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleArea.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleArea.java index 9ae9631..825fc40 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleArea.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleArea.java @@ -29,6 +29,12 @@ import static net.forwardfire.unitxc.model.UnitXCGroupType.SI_DERIVED; import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 26, 2015 + */ public class UnitXCModuleArea implements UnitXCConfigModule { private static final int UNIT_COMPOUND_EXPONENT = 2; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleElectricCurrent.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleElectricCurrent.java index 1979b84..f157673 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleElectricCurrent.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleElectricCurrent.java @@ -30,6 +30,12 @@ import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; import net.forwardfire.unitxc.config.builder.UnitXCTypeSIPrefix; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 18, 2015 + */ public class UnitXCModuleElectricCurrent implements UnitXCConfigModule { public static final String GROUP_ID = "current"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLength.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLength.java index 8698ea5..11d2c89 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLength.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLength.java @@ -30,6 +30,12 @@ import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; import net.forwardfire.unitxc.config.builder.UnitXCTypeSIPrefix; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 24, 2015 + */ public class UnitXCModuleLength implements UnitXCConfigModule { public static final String GROUP_ID = "length"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLuminousIntensity.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLuminousIntensity.java index 62215ba..2b9dda3 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLuminousIntensity.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleLuminousIntensity.java @@ -29,6 +29,12 @@ import static net.forwardfire.unitxc.model.UnitXCGroupType.SI_BASE; import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 23, 2015 + */ public class UnitXCModuleLuminousIntensity implements UnitXCConfigModule { public static final String GROUP_ID = "light"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleMass.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleMass.java index c406594..1bc4617 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleMass.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleMass.java @@ -30,6 +30,12 @@ import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; import net.forwardfire.unitxc.config.builder.UnitXCTypeSIPrefix; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 25, 2015 + */ public class UnitXCModuleMass implements UnitXCConfigModule { public static final String GROUP_ID = "mass"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTemperature.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTemperature.java index b0f7fbd..2930460 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTemperature.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTemperature.java @@ -31,6 +31,12 @@ import static net.forwardfire.unitxc.model.UnitXCGroupType.SI_BASE; import org.apache.commons.lang3.math.Fraction; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ public class UnitXCModuleTemperature implements UnitXCConfigModule { public static final String GROUP_ID = "temperature"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTime.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTime.java index 3e9c534..12b6ea9 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTime.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleTime.java @@ -30,6 +30,12 @@ import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; import net.forwardfire.unitxc.config.builder.UnitXCTypeSIPrefix; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 25, 2015 + */ public class UnitXCModuleTime implements UnitXCConfigModule { public static final String GROUP_ID = "time"; diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleVolume.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleVolume.java index a482d15..e818f30 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleVolume.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/module/UnitXCModuleVolume.java @@ -29,6 +29,12 @@ import static net.forwardfire.unitxc.model.UnitXCGroupType.SI_DERIVED; import net.forwardfire.unitxc.config.UnitXCConfigModule; import net.forwardfire.unitxc.config.builder.UnitXCConfigBuilder; +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 28, 2015 + */ public class UnitXCModuleVolume implements UnitXCConfigModule { private static final int UNIT_COMPOUND_EXPONENT = 3; diff --git a/ff-unitxc-converter/src/test/java/net/forwardfire/unitxc/UnitXCConverterStepTest.java b/ff-unitxc-converter/src/test/java/net/forwardfire/unitxc/UnitXCConverterStepTest.java index 1def5d5..1ec6a64 100644 --- a/ff-unitxc-converter/src/test/java/net/forwardfire/unitxc/UnitXCConverterStepTest.java +++ b/ff-unitxc-converter/src/test/java/net/forwardfire/unitxc/UnitXCConverterStepTest.java @@ -71,7 +71,7 @@ public class UnitXCConverterStepTest { System.out.println("totalConv: "+(ts*ts-ts)); UnitXConverterResult result = unitManager.getConverter().convertStepped(211.0, "k°F", "m°C"); - System.out.println("Convert from: "+result.getStartType().getName()+" to: "+result.getResultType().getName()); + System.out.println("Convert from: "+result.getStartValueType().getName()+" to: "+result.getResultValueType().getName()); System.out.println("startValue: "+result.getStartValue()); System.out.println("resultValue: "+result.getResultValue()); System.out.println("convertTime: "+result.getConvertTime()); @@ -82,7 +82,7 @@ public class UnitXCConverterStepTest { System.out.println(""); result = unitManager.getConverter().convertStepped(10.763, "ft²", "in²"); - System.out.println("Convert from: "+result.getStartType().getName()+" to: "+result.getResultType().getName()); + System.out.println("Convert from: "+result.getStartValueType().getName()+" to: "+result.getResultValueType().getName()); System.out.println("startValue: "+result.getStartValue()); System.out.println("resultValue: "+result.getResultValue()); System.out.println("convertTime: "+result.getConvertTime()); @@ -93,7 +93,7 @@ public class UnitXCConverterStepTest { System.out.println(""); result = unitManager.getConverter().convertStepped(10.763, "ft³", "in³"); - System.out.println("Convert from: "+result.getStartType().getName()+" to: "+result.getResultType().getName()); + System.out.println("Convert from: "+result.getStartValueType().getName()+" to: "+result.getResultValueType().getName()); System.out.println("startValue: "+result.getStartValue()); System.out.println("resultValue: "+result.getResultValue()); System.out.println("convertTime: "+result.getConvertTime());