Example usage for java.lang Float Float

List of usage examples for java.lang Float Float

Introduction

In this page you can find the example usage for java.lang Float Float.

Prototype

@Deprecated(since = "9")
public Float(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Float object that represents the floating-point value of type float represented by the string.

Usage

From source file:org.squale.squaleweb.applicationlayer.action.export.ppt.AuditReportPPTData.java

/**
 * Build factors sorted map : key = factorName value = result for current audit
 * //from  w w w.  j a  v  a2  s. com
 * @param qualityResults quality results
 * @return the sorted map for kiviat graph
 */
private SortedMap buildSortedMapForKiviat(List qualityResults) {
    SortedMap results = new TreeMap();
    for (int i = 0; i < qualityResults.size(); i++) {
        QualityReportDTO factor = (QualityReportDTO) qualityResults.get(i);
        results.put(factor.getRule().getName().replaceFirst("rule\\.", ""), new Float(factor.getMeanMark()));
    }
    return results;
}

From source file:com.thinkbiganalytics.spark.validation.HCatDataType.java

public <T extends Comparable> T toNativeValue(String val) throws InvalidFormatException {
    try {//  www  .  j  a  v  a2  s. co m
        if (StringUtils.isEmpty(val) || convertibleType == String.class) {
            return (unchecked || isstring ? (T) val : null);
        } else if (convertibleType == Integer.class) {
            return (T) new Integer(val);
        } else if (convertibleType == Double.class) {
            return (T) new Double(val);
        } else if (convertibleType == Float.class) {
            return (T) new Float(val);
        } else if (convertibleType == BigInteger.class) {
            return (T) new BigInteger(val);
        } else if (convertibleType == BigDecimal.class) {
            return (T) new BigDecimal(val);
        } else {
            throw new RuntimeException(
                    "Unexpected conversion [" + convertibleType + "] for value [" + val + "]");
        }
    } catch (NumberFormatException | ClassCastException e) {
        throw new InvalidFormatException(this, val);
    }
}

From source file:com.edmunds.autotest.AutoTestGetterSetter.java

private static Map<Class<?>, Object> createDefaultValueMap() {
    Map<Class<?>, Object> valueMap = new HashMap<Class<?>, Object>();

    valueMap.put(byte.class, new Byte((byte) 0));
    valueMap.put(short.class, new Short((short) 0));
    valueMap.put(int.class, new Integer(0));
    valueMap.put(long.class, new Long(0));
    valueMap.put(float.class, new Float(0));
    valueMap.put(double.class, new Double(0));
    valueMap.put(boolean.class, Boolean.FALSE);
    valueMap.put(char.class, new Character((char) 0));

    valueMap.put(Byte.class, new Byte((byte) 0));
    valueMap.put(Short.class, new Short((short) 0));
    valueMap.put(Integer.class, new Integer(0));
    valueMap.put(Long.class, new Long(0));
    valueMap.put(Float.class, new Float(0));
    valueMap.put(Double.class, new Double(0));
    valueMap.put(Boolean.class, Boolean.FALSE);
    valueMap.put(Character.class, new Character((char) 0));

    return valueMap;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJAreaChartBuilder.java

/**
 * Sets the line width./*from  www .  j a v a  2 s  .  c  o m*/
 *
 * @param lineWidth the line width
 **/
public DJAreaChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJBarChartBuilder.java

/**
 * Sets the line width.//from  www.  jav  a  2s .c  om
 *
 * @param lineWidth the line width
 **/
public DJBarChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJLineChartBuilder.java

/**
 * Sets the line width.//from  ww  w  . ja  v a 2  s  .  co  m
 *
 * @param lineWidth the line width
 **/
public DJLineChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJXYAreaChartBuilder.java

/**
 * Sets the line width.//from  w w  w . ja v  a 2s  .c  om
 *
 * @param lineWidth the line width
 **/
public DJXYAreaChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJXYBarChartBuilder.java

/**
 * Sets the line width.//w  w  w.ja  v a2  s . c  om
 *
 * @param lineWidth the line width
 **/
public DJXYBarChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJBar3DChartBuilder.java

/**
 * Sets the line width./*from   w w w .j a  va2s .  c  om*/
 *
 * @param lineWidth the line width
 **/
public DJBar3DChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}

From source file:ar.com.fdvs.dj.domain.chart.builder.DJXYLineChartBuilder.java

/**
 * Sets the line width./*from   w  w w .j  a v a  2 s. c  o m*/
 *
 * @param lineWidth the line width
 **/
public DJXYLineChartBuilder setLineWidth(float lineWidth) {
    this.chart.getOptions().setLineWidth(new Float(lineWidth));
    return this;
}