Example usage for java.lang Double MAX_VALUE

List of usage examples for java.lang Double MAX_VALUE

Introduction

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

Prototype

double MAX_VALUE

To view the source code for java.lang Double MAX_VALUE.

Click Source Link

Document

A constant holding the largest positive finite value of type double , (2-2-52)·21023.

Usage

From source file:com.bitranger.parknshop.common.service.ItemFinderService.java

public List<PsItem> list() {

    Integer categoryId = -1;/*  w w  w  .ja  va2  s.c  o  m*/
    List<Integer> tagIds = null;
    Double maxPrice = Double.MAX_VALUE;
    Double minPrice = 0.0;
    Integer pageNumber = 1;
    String orderBy = null;
    boolean asd = false;

    categoryId = Integer.parseInt(sCategoryId);
    orderBy = sOrderBy;

    if (stagIds != null) {

        Integer[] itagIds = new Integer[stagIds.length];

        for (int i = 0; i < stagIds.length; i++) {
            itagIds[i] = Integer.parseInt(stagIds[i]);
        }
        tagIds = Arrays.asList(itagIds);
    }
    if (sMaxPrice != null) {
        maxPrice = Double.parseDouble(sMaxPrice);
    }
    if (sMinPrice != null) {
        minPrice = Double.parseDouble(sMinPrice);
    }
    if (sPageNumber != null) {
        pageNumber = Integer.parseInt(sPageNumber);
    }
    if (sAsd != null) {
        if (sAsd.equals("asd")) {
            asd = true;
        }
    }

    List<PsItem> items = null;

    if (asd) {

        items = itemFinder.newFind().categoryId(categoryId).tagIDs(tagIds).maxPrice(maxPrice).minPrice(minPrice)
                .orderBy(orderBy).ascending().page(pageNumber).list();
        this.clear();

    } else {

        itemFinder.toString();

        items = itemFinder.newFind().categoryId(categoryId).tagIDs(tagIds).maxPrice(maxPrice).minPrice(minPrice)
                .orderBy(orderBy).descending().page(pageNumber).list();
        this.clear();
    }
    return items;
}

From source file:com.opengamma.maths.lowlevelapi.functions.utilities.Min.java

/**
 * Returns the minimum value in data/*  w  w  w . ja  v a 2  s .c om*/
 * @param data the data to search
 * @return min, the minimum
 */
public static double value(double... data) {
    Validate.notNull(data);
    double min = Double.MAX_VALUE;
    final int n = data.length;
    for (int i = 0; i < n; i++) {
        if (data[i] < min) {
            min = data[i];
        }
    }
    return min;
}

From source file:cz.cvut.kbss.jsonld.jackson.serialization.JacksonJsonWriterTest.java

@Test
public void writeNumberDoubleWritesDouble() throws Exception {
    final Double number = Double.MAX_VALUE;
    writer.writeNumber(number);//w w w .  jav a  2  s  .  c  o m
    verify(generator).writeNumber(number);
}

From source file:calendarioSeries.vistas.NewSerieController.java

@FXML
public void handleOk() {
    String tituloAux = titulo.getText().replaceAll(" ", "+").toLowerCase();
    String toJson = readUrl(BASE + tituloAux + "&type=series" + "&r=json");
    resultados.getChildren().clear();//from w ww  . j av a  2s.co  m
    try {
        JSONObject busqueda = new JSONObject(toJson);
        if (busqueda.getString("Response").equals("True")) {
            JSONArray res = busqueda.getJSONArray("Search");
            resultados.setPrefRows(res.length());
            for (int i = 0; i < res.length(); i++) {
                JSONObject resActual = new JSONObject(res.get(i).toString());
                HBox resultadoActual = new HBox(50);
                resultadoActual.setMaxWidth(Double.MAX_VALUE);
                resultadoActual.setAlignment(Pos.CENTER_LEFT);
                ImageView posterActual = new ImageView();

                try {
                    Image image = new Image(resActual.getString("Poster"));
                    posterActual.setImage(image);
                    posterActual.setFitHeight(240);
                    posterActual.setFitWidth(180);
                    posterActual.setPreserveRatio(false);
                    resultadoActual.getChildren().add(posterActual);
                } catch (IllegalArgumentException e) {
                    //                        System.out.println("Bad url");
                    Image image = new Image(
                            MainApp.class.getResource("resources/no-image.png").toExternalForm());
                    posterActual.setImage(image);
                    posterActual.setFitHeight(240);
                    posterActual.setFitWidth(180);
                    posterActual.setPreserveRatio(false);
                    resultadoActual.getChildren().add(posterActual);
                }

                String details;
                String nomSerie = new String(resActual.getString("Title").getBytes(), "UTF-8");
                String anoSerie = new String(resActual.getString("Year").getBytes(), "UTF-8");
                if (nomSerie.length() > 15) {
                    details = "%-12.12s...\t\t Ao: %-10s";
                } else {
                    details = "%-12s\t\t Ao: %-10s";
                }
                details = String.format(details, nomSerie, anoSerie);
                Label elemento = new Label(details);
                elemento.setMaxWidth(Double.MAX_VALUE);
                elemento.setMaxHeight(Double.MAX_VALUE);
                resultadoActual.getChildren().add(elemento);

                posterActual.setId(resActual.getString("imdbID"));
                posterActual.setOnMouseClicked(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                        ImageView clickedButton = (ImageView) event.getSource();
                        Stage stage = (Stage) clickedButton.getScene().getWindow();
                        Task task = new Task() {
                            @Override
                            protected Object call() throws Exception {
                                mainController.mainApp.scene.setCursor(Cursor.WAIT);
                                Serie toAdd = new Serie(clickedButton.getId());
                                boolean possible = true;
                                for (Serie serie : mainController.getSeries()) {
                                    if (serie.equals(toAdd))
                                        possible = false;
                                }
                                if (possible)
                                    mainController.getSeries().add(toAdd);

                                try {
                                    mainController.populateImagenes();
                                    mainController.showDetallesMes(mainController.getMesActual());
                                } catch (Exception e) {
                                    e.printStackTrace();
                                } finally {
                                    mainController.mainApp.scene.setCursor(Cursor.DEFAULT);

                                    return mainController.getSeries();
                                }
                            }
                        };
                        Thread th = new Thread(task);
                        th.setDaemon(true);
                        th.start();
                        stage.close();
                    }
                });
                resultados.getChildren().add(resultadoActual);
            }
        } else {
            resultados.getChildren().add(new Label("La busqueda no obtuvo resultados"));
        }
    } catch (JSONException e) {
        e.printStackTrace();
    } catch (UnsupportedEncodingException ex) {
        Logger.getLogger(NewSerieController.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:com.redhat.lightblue.metadata.types.DoubleTypeTest.java

@Test
public void testFromJson() {
    JsonNode jsonNode = JsonNodeFactory.withExactBigDecimals(true).numberNode(Double.MAX_VALUE);
    Object fromJson = doubleType.fromJson(jsonNode);
    assertTrue(fromJson instanceof Double);
}

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  w w  w. j av  a2  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:guineu.modules.dataanalysis.zeroImputation.ZeroImputationTask.java

private double getMinimun(PeakListRow row, List<String> columnName) {
    double min = Double.MAX_VALUE;
    for (String name : columnName) {
        double value = (Double) row.getPeak(name);
        if (value > 0 && value < min) {
            min = value;//from  w w  w .  j  a v a  2  s .co  m
        }
    }
    return min;
}

From source file:peakml.util.jfreechart.FastErrorBarPlot.java

public void clear() {
    ymin = Double.MAX_VALUE;
    ymax = Double.MIN_VALUE;
    dataseries.clear();
}

From source file:peakml.util.jfreechart.FastSpectrumPlot.java

public void clear() {
    xmin = Double.MAX_VALUE;
    xmax = Double.MIN_VALUE;
    ymax = Double.MIN_VALUE;

    dataseries.clear();
    this.fireChangeEvent();
}

From source file:mt.listeners.WriteStatsListener.java

public double leastStart(ArrayList<Pair<AbstractFunction2D, ArrayList<PointFunctionMatch>>> segments) {

    double minstartY = Double.MAX_VALUE;

    double minstartX = leastX(segments);

    for (final Pair<AbstractFunction2D, ArrayList<PointFunctionMatch>> result : segments) {

        final Pair<Double, Double> minMax = Tracking.fromTo(result.getB());

        double startX = minMax.getA();
        Polynomial<?, Point> polynomial = (Polynomial) result.getA();
        double startY = polynomial.predict(startX);

        if (startY <= minstartY && startX != 0) {

            minstartY = startY;//from  w  ww  .  j a  v a 2s. c o  m

        }

    }

    return minstartY;

}