Example usage for java.lang Double Double

List of usage examples for java.lang Double Double

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:com.bstek.dorado.data.type.PrimitiveDoubleDataType.java

@Override
public Object fromObject(Object value) {
    if (value == null) {
        return new Double(0);
    }/*from   w  ww . j  av a2  s.  co  m*/
    return super.fromObject(value);
}

From source file:com.jaxzin.iraf.demo.CdfInv.java

private static CategoryDataset createData(int count) {
    DefaultCategoryDataset data = new DefaultCategoryDataset();
    for (int i = 1; i < count; i++) {
        double in = (1.0 / count) * i;
        double out = MoreMath.cdfinv(in);
        data.addValue(out, "nor", new Double(in));
    }//  ww  w.  j  a va  2  s  . c o m
    return data;
}

From source file:com.taobao.ad.easyschedule.dao.datatracking.impl.JPADataTrackingJobDAOImpl.java

public Double getDataTrackingData(final String trackingsql) {
    Object obj = this.getJpaTemplate().execute(new JpaCallback() {
        @Override/*from  w w w.j  av  a 2s .  c o  m*/
        public Object doInJpa(EntityManager em) throws PersistenceException {
            return em.createNativeQuery(trackingsql).getSingleResult();
        }
    });
    return new Double(obj.toString());
}

From source file:org.jfree.chart.demo.BoxAndWhiskerChartDemo2.java

private static List<Double> createValueList(double d, double d1, int i) {
    ArrayList<Double> arraylist = new ArrayList<Double>();
    for (int j = 0; j < i; j++) {
        double d2 = d + Math.random() * (d1 - d);
        arraylist.add(new Double(d2));
    }/*w  ww .  j  a  va 2 s.  c  om*/

    return arraylist;
}

From source file:com.orca.app.LicenseTests.java

@Test
public void weightedValueTest() {
    License license = new License();
    license.populate();// w  w  w. jav a2  s .  c  om
    assertTrue(license.getCalculatedValue() == new Double(10));
    Evaluation evaluation = factory.createEvalution();
    evaluation.setLicenseWeight(50);
    Survey survey = evaluation.getSurveyList().get(0);
    survey.setLicense(license);
    assertTrue((license.getWeightedValue(survey) == (new Double(5))));
}

From source file:Main.java

/** Transforms an array of primitives
 * to an array of Numbers./*from w  w  w  .  ja v a2s.  c o  m*/
 */
public static Number[] transformArray(double[] data) {
    Number[] n = new Number[data.length];

    for (int i = 0; i < data.length; i++)
        n[i] = new Double(data[i]);

    return n;
}

From source file:edu.uci.ics.jung.visualization.decorators.ConstantDirectionalEdgeValueTransformer.java

/**
 * /* w  w  w.  ja v  a 2s .  c om*/
 * @param undirected
 * @param directed
 */
public ConstantDirectionalEdgeValueTransformer(double undirected, double directed) {
    this.undirected_value = new Double(undirected);
    this.directed_value = new Double(directed);
}

From source file:Componentes.TermometroMax.java

@Override
public void pintar(javax.swing.JPanel p, int pos) {
    p.removeAll();/*from   ww w . j a  v a2  s.  c  o m*/
    DefaultValueDataset data = new DefaultValueDataset(new Double(ventana.getGraphdata().getTmax()));

    ThermometerPlot plot = new ThermometerPlot(data);
    chart = new JFreeChart("Temperatura Maxima, \nMES: " + Calculos.get_mes(ventana.getMonthdata().getdata()), // chart title
            JFreeChart.DEFAULT_TITLE_FONT, plot, // plot
            false);

    Color Darkorange = new Color(255, 140, 0);
    Color Crimson = new Color(220, 20, 60);
    Color Aquamarine = new Color(127, 255, 212);
    Color Darkslategray = new Color(47, 79, 79);

    plot.setMercuryPaint(Aquamarine);
    plot.setSubrange(NORMAL, 0, 10);
    plot.setSubrange(WARNING, 10.1, 20);
    plot.setSubrange(CRITICAL, 20.1, 50);
    plot.setSubrangePaint(NORMAL, Aquamarine);
    plot.setSubrangePaint(WARNING, Darkorange);
    plot.setSubrangePaint(CRITICAL, Crimson);

    plot.setThermometerStroke(new BasicStroke(2.0f));
    plot.setThermometerPaint(Darkslategray);

    plot.setDisplayRange(5, Calculos.get_min(datos.getTmax()), Calculos.get_max(datos.getTmax()));
    plot.setRange(Calculos.get_min(datos.getTmax()), Calculos.get_max(datos.getTmax()));

    panel = new ChartPanel(chart);
    panel.setBounds(5, 5, 300, 300);
    panel.repaint();
    p.add(panel);
    // jPanel1.repaint();
    p.updateUI();
    // aoIndex=aoAux;
    ///aoAux = 0;
}

From source file:Grafica.java

private void init() {
    panel = new JPanel();
    getContentPane().add(panel);/* w  w w  . j av  a2  s . c  o m*/
    // Fuente de Datos
    DefaultPieDataset defaultpiedataset = new DefaultPieDataset();
    defaultpiedataset.setValue("Abiertas 81%", new Double(81D));
    defaultpiedataset.setValue("Cerradas 19%", new Double(19D));
    //        defaultpiedataset.setValue("Hacking", new Double(19.5D));
    //        defaultpiedataset.setValue("SEO", new Double(30.5D));
    //        defaultpiedataset.setValue("Redes", new Double(2.0D));

    // Creando el Grafico
    JFreeChart chart = ChartFactory.createPieChart3D("Informe De Asignacin De Clases", defaultpiedataset,
            true, true, false);
    PiePlot3D pieplot3d = (PiePlot3D) chart.getPlot();
    pieplot3d.setDepthFactor(0.5);
    pieplot3d.setStartAngle(290D);
    pieplot3d.setDirection(Rotation.CLOCKWISE);
    pieplot3d.setForegroundAlpha(0.5F);

    // Mostrar Grafico
    ChartPanel chartPanel = new ChartPanel(chart);
    panel.add(chartPanel);
}

From source file:net.duckling.ddl.util.EncodeUtil.java

private static int getRandomNumber() {
    double a = Math.random() * 10;
    a = Math.ceil(a);//from w  w w.  j  a va 2 s .  c  o m
    int decimal = new Double(a).intValue();
    return decimal % 10;
}