com.github.TKnudsen.ComplexDataObject.data.features.numericalData.NumericalFeature Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of complex-data-object Show documentation
Show all versions of complex-data-object Show documentation
A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.
The newest version!
package com.github.TKnudsen.ComplexDataObject.data.features.numericalData;
import com.github.TKnudsen.ComplexDataObject.data.features.Feature;
import com.github.TKnudsen.ComplexDataObject.data.features.FeatureType;
/**
*
* Title: NumericalFeature
*
*
*
* Description:
*
*
*
* Copyright: Copyright (c) 2016-2017
*
*
* @author Juergen Bernard
* @version 1.02
*/
public class NumericalFeature extends Feature {
/**
*
*/
private static final long serialVersionUID = 7244765037515290604L;
private NumericalFeature() {
super(FeatureType.DOUBLE);
}
public NumericalFeature(String featureName, Double featureValue) {
super(featureName, featureValue, FeatureType.DOUBLE);
}
@Override
public String toString() {
if (featureName != null)
return featureName + ", " + featureValue + " (" + featureType.name() + ") ";
return featureValue + " (" + featureType.name() + ") ";
}
public double doubleValue() {
return featureValue.doubleValue();
}
@Override
public NumericalFeature clone() {
return new NumericalFeature(featureName, featureValue);
}
}