Example usage for java.lang Double doubleValue

List of usage examples for java.lang Double doubleValue

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public double doubleValue() 

Source Link

Document

Returns the double value of this Double object.

Usage

From source file:org.jcurl.model.PathSet.java

public void append(double t0, PathSegment curve) {
    if (pieces.size() > 0) {
        final Double last = (Double) pieces.lastKey();
        if (t0 <= last.doubleValue())
            throw new IllegalArgumentException("t0 <= tmax");
    }//from www.  ja v a2s.  c o m
    pieces.put(new Double(t0), curve);
}

From source file:org.apache.hadoop.hive.ql.udf.UDFOPNegative.java

public Double evaluate(Double a) {
    if (a == null)
        return null;

    Double r = Double.valueOf(-a.doubleValue());
    return r;//from  w w  w .  j a va  2 s  .  c  om
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.DoubleCalculator.java

public Object add(Object obj1, Object obj2) {
    Double doubleData1 = (Double) obj1;
    Double doubleData2 = (Double) obj2;

    return (Object) (new Double((double) (doubleData1.doubleValue() + doubleData2.doubleValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.DoubleCalculator.java

public Object div(Object obj1, Object obj2) {
    Double doubleData1 = (Double) obj1;
    Double doubleData2 = (Double) obj2;

    return (Object) (new Double((double) (doubleData1.doubleValue() / doubleData2.doubleValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.DoubleCalculator.java

public Object mul(Object obj1, Object obj2) {
    Double doubleData1 = (Double) obj1;
    Double doubleData2 = (Double) obj2;

    return (Object) (new Double((double) (doubleData1.doubleValue() * doubleData2.doubleValue())));
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.DoubleCalculator.java

public Object sub(Object obj1, Object obj2) {
    Double doubleData1 = (Double) obj1;
    Double doubleData2 = (Double) obj2;

    return (Object) (new Double((double) (doubleData1.doubleValue() - doubleData2.doubleValue())));
}

From source file:org.apache.hadoop.hive.ql.udf.UDFToBoolean.java

public Boolean evaluate(Double i) {
    if (i == null) {
        return null;
    } else {//from w w  w  .  j a  v  a2s  .co m
        return Boolean.valueOf(i.doubleValue() == 0);
    }
}

From source file:eu.optimis.ecoefficiencytool.core.tools.InfrastructureMetrics.java

/**
 * Returns the benchmark result obtained by this node. If it doesn't exist,
 * it returns the lowest value of all the results of all the nodes.
 *
 * @param nodeId Node Identifier.//from   www  .ja  va 2 s .  c o m
 * @return Benchmark result if existent, minimum benchmark result otherwise.
 */
public double getNodeBenchmarkResult(String nodeId) {
    if (benchmarkScore.containsKey(nodeId)) {
        return benchmarkScore.get(nodeId).doubleValue();
    } else {
        double minvalue = Double.MAX_VALUE;
        for (Double value : benchmarkScore.values()) {
            if (value.doubleValue() < minvalue) {
                minvalue = value.doubleValue();
            }
        }
        return minvalue;
    }
}

From source file:com.baidu.gcrm.customer.web.validator.CustomerSubmitValidator.java

@Override
public void validate(Object target, Errors errors) {
    CustomerBean customerBean = (CustomerBean) target;

    Customer customer = ServiceBeanFactory.getCustomerService().findById(customerBean.getCustomer().getId());
    customerBean.setCustomer(customer);//from   www  . j  a va  2  s .  c  om

    ValidationUtils.invokeValidator(new CustomerValidator(), customer, errors);
    ValidationUtils.invokeValidator(new CustomerTypeChangeValidator(), customer, errors);
    if (customer.getCompanyStatus() == CustomerState.disabled.ordinal()) {
        errors.rejectValue("customer.approvalStatus", "customer.disabled.submit.forbidden");
    }
    // ???? add by cch
    if (errors.hasErrors()) {
        return;
    }
    validatorNameAndLicense(customer, errors);

    Long customerNumber = customer.getId();
    List<ContactPerson> contacts = ServiceBeanFactory.getContactService()
            .findContactsByCustomerNumber(customerNumber);
    if (contacts != null && contacts.size() > CONTACT_LIMIT) {
        errors.rejectValue("", "contact.size.invalid");
    }

    if (CollectionUtils.isNotEmpty(contacts)) {
        int i = 0;
        for (ContactPerson temContactPerson : contacts) {
            ContactPersonValidator.validateSingleContactPerson(errors,
                    new StringBuilder("contacts[").append(i).append("].").toString(), temContactPerson, true);
            i++;
        }
    }

    Opportunity opportunity = ServiceBeanFactory.getOpportunityService()
            .findOpportunityByCustomerNumber(customerNumber);
    if (opportunity != null) {
        Double budget = opportunity.getBudget();
        if (budget != null && budget.doubleValue() < 0) {
            errors.rejectValue("opportunity.budget", "opportunity.budget.number");
        }
    }

    Qualification qualification = ServiceBeanFactory.getQualificationService()
            .findByCustomerNumber(customerNumber);
    if (qualification != null) {
        ValidationUtils.invokeValidator(new QualificationValidator(), qualification, errors);
    }
}

From source file:de.dhke.projects.cutil.collections.WeightedSet.java

@Override
public Double put(K key, Double value) {
    if ((value == null) || (value.doubleValue() == 0.0)) {
        value = get(key);/*from   w ww .  j a va  2 s. c  o  m*/
        remove(key);
        return value;
    } else {
        final Double oldValue = _backend.put(key, value);
        if (oldValue == null)
            return 0.0;
        else
            return oldValue;
    }
}