List of usage examples for java.lang Double MIN_VALUE
double MIN_VALUE
To view the source code for java.lang Double MIN_VALUE.
Click Source Link
From source file:com.litt.core.security.license.gui.ValidatePanel.java
/** * Create the panel.//from w w w . j a v a 2s .co m */ public ValidatePanel() { GridBagLayout gbl_validatePanel = new GridBagLayout(); gbl_validatePanel.columnWidths = new int[] { 0, 0, 0 }; gbl_validatePanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_validatePanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_validatePanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; this.setLayout(gbl_validatePanel); JLabel label_10 = new JLabel(""); GridBagConstraints gbc_label_10 = new GridBagConstraints(); gbc_label_10.insets = new Insets(0, 0, 5, 5); gbc_label_10.anchor = GridBagConstraints.EAST; gbc_label_10.gridx = 0; gbc_label_10.gridy = 0; this.add(label_10, gbc_label_10); field_pubKeyFilePath = new JTextField(); field_pubKeyFilePath.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { JFileChooser fileChooser = new JFileChooser(); //fileChooser.setVisible(true); LicenseFileFilter fileFilter = new LicenseFileFilter(new String[] { "key" }); fileChooser.setFileFilter(fileFilter); fileChooser.addChoosableFileFilter(fileFilter); fileChooser.showOpenDialog(e.getComponent()); File pubKeyFile = fileChooser.getSelectedFile(); field_pubKeyFilePath.setText(pubKeyFile.getAbsolutePath()); } }); GridBagConstraints gbc_field_pubKeyFilePath = new GridBagConstraints(); gbc_field_pubKeyFilePath.insets = new Insets(0, 0, 5, 0); gbc_field_pubKeyFilePath.fill = GridBagConstraints.HORIZONTAL; gbc_field_pubKeyFilePath.gridx = 1; gbc_field_pubKeyFilePath.gridy = 0; this.add(field_pubKeyFilePath, gbc_field_pubKeyFilePath); field_pubKeyFilePath.setColumns(10); JLabel label_19 = new JLabel("?"); GridBagConstraints gbc_label_19 = new GridBagConstraints(); gbc_label_19.anchor = GridBagConstraints.EAST; gbc_label_19.insets = new Insets(0, 0, 5, 5); gbc_label_19.gridx = 0; gbc_label_19.gridy = 1; this.add(label_19, gbc_label_19); field_licenseFilePath = new JTextField(); field_licenseFilePath.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { JFileChooser fileChooser = new JFileChooser(); //fileChooser.setVisible(true); LicenseFileFilter fileFilter = new LicenseFileFilter(new String[] { "xml" }); fileChooser.setFileFilter(fileFilter); fileChooser.addChoosableFileFilter(fileFilter); fileChooser.showOpenDialog(e.getComponent()); File licenseFile = fileChooser.getSelectedFile(); field_licenseFilePath.setText(licenseFile.getAbsolutePath()); } }); GridBagConstraints gbc_textField1 = new GridBagConstraints(); gbc_textField1.insets = new Insets(0, 0, 5, 0); gbc_textField1.fill = GridBagConstraints.HORIZONTAL; gbc_textField1.gridx = 1; gbc_textField1.gridy = 1; this.add(field_licenseFilePath, gbc_textField1); field_licenseFilePath.setColumns(10); JLabel lblid = new JLabel("?ID"); lblid.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_lblid = new GridBagConstraints(); gbc_lblid.insets = new Insets(0, 0, 5, 5); gbc_lblid.gridx = 0; gbc_lblid.gridy = 2; this.add(lblid, gbc_lblid); label_licenseId = new JLabel(""); label_licenseId.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_label_licenseId = new GridBagConstraints(); gbc_label_licenseId.insets = new Insets(0, 0, 5, 0); gbc_label_licenseId.gridx = 1; gbc_label_licenseId.gridy = 2; this.add(label_licenseId, gbc_label_licenseId); JLabel label_12 = new JLabel("?"); GridBagConstraints gbc_label_12 = new GridBagConstraints(); gbc_label_12.insets = new Insets(0, 0, 5, 5); gbc_label_12.gridx = 0; gbc_label_12.gridy = 3; this.add(label_12, gbc_label_12); label_licenseType = new JLabel(""); GridBagConstraints gbc_label_licenseType = new GridBagConstraints(); gbc_label_licenseType.insets = new Insets(0, 0, 5, 0); gbc_label_licenseType.gridx = 1; gbc_label_licenseType.gridy = 3; this.add(label_licenseType, gbc_label_licenseType); JLabel label_13 = new JLabel("???"); GridBagConstraints gbc_label_13 = new GridBagConstraints(); gbc_label_13.insets = new Insets(0, 0, 5, 5); gbc_label_13.gridx = 0; gbc_label_13.gridy = 4; this.add(label_13, gbc_label_13); label_productName = new JLabel(""); GridBagConstraints gbc_label_productName = new GridBagConstraints(); gbc_label_productName.insets = new Insets(0, 0, 5, 0); gbc_label_productName.gridx = 1; gbc_label_productName.gridy = 4; this.add(label_productName, gbc_label_productName); JLabel label_14 = new JLabel("???"); GridBagConstraints gbc_label_14 = new GridBagConstraints(); gbc_label_14.insets = new Insets(0, 0, 5, 5); gbc_label_14.gridx = 0; gbc_label_14.gridy = 5; this.add(label_14, gbc_label_14); label_companyName = new JLabel(""); GridBagConstraints gbc_label_companyName = new GridBagConstraints(); gbc_label_companyName.insets = new Insets(0, 0, 5, 0); gbc_label_companyName.gridx = 1; gbc_label_companyName.gridy = 5; this.add(label_companyName, gbc_label_companyName); JLabel label_15 = new JLabel("??"); GridBagConstraints gbc_label_15 = new GridBagConstraints(); gbc_label_15.insets = new Insets(0, 0, 5, 5); gbc_label_15.gridx = 0; gbc_label_15.gridy = 6; this.add(label_15, gbc_label_15); label_customerName = new JLabel(""); GridBagConstraints gbc_label_customerName = new GridBagConstraints(); gbc_label_customerName.insets = new Insets(0, 0, 5, 0); gbc_label_customerName.gridx = 1; gbc_label_customerName.gridy = 6; this.add(label_customerName, gbc_label_customerName); JLabel label_16 = new JLabel(""); GridBagConstraints gbc_label_16 = new GridBagConstraints(); gbc_label_16.insets = new Insets(0, 0, 5, 5); gbc_label_16.gridx = 0; gbc_label_16.gridy = 7; this.add(label_16, gbc_label_16); label_version = new JLabel(""); GridBagConstraints gbc_label_version = new GridBagConstraints(); gbc_label_version.insets = new Insets(0, 0, 5, 0); gbc_label_version.gridx = 1; gbc_label_version.gridy = 7; this.add(label_version, gbc_label_version); JLabel label_11 = new JLabel(""); GridBagConstraints gbc_label_11 = new GridBagConstraints(); gbc_label_11.insets = new Insets(0, 0, 5, 5); gbc_label_11.gridx = 0; gbc_label_11.gridy = 8; this.add(label_11, gbc_label_11); label_createDate = new JLabel(""); GridBagConstraints gbc_label_createDate = new GridBagConstraints(); gbc_label_createDate.insets = new Insets(0, 0, 5, 0); gbc_label_createDate.gridx = 1; gbc_label_createDate.gridy = 8; this.add(label_createDate, gbc_label_createDate); JLabel label_17 = new JLabel(""); GridBagConstraints gbc_label_17 = new GridBagConstraints(); gbc_label_17.insets = new Insets(0, 0, 5, 5); gbc_label_17.gridx = 0; gbc_label_17.gridy = 9; this.add(label_17, gbc_label_17); label_expiredDate = new JLabel(""); GridBagConstraints gbc_label_expiredDate = new GridBagConstraints(); gbc_label_expiredDate.insets = new Insets(0, 0, 5, 0); gbc_label_expiredDate.gridx = 1; gbc_label_expiredDate.gridy = 9; this.add(label_expiredDate, gbc_label_expiredDate); JButton button_2 = new JButton(""); button_2.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { String licenseFilePath = Utility.trimNull(field_licenseFilePath.getText()); String pubKeyFilePath = Utility.trimNull(field_pubKeyFilePath.getText()); if (Utility.isEmpty(licenseFilePath)) { JOptionPane.showMessageDialog(e.getComponent(), "?!"); return; } if (Utility.isEmpty(pubKeyFilePath)) { JOptionPane.showMessageDialog(e.getComponent(), "!"); return; } File licenseFile = new File(licenseFilePath); try { XMLConfiguration config = new XMLConfiguration(licenseFile); config.setAutoSave(true); label_licenseId.setText(config.getString(("licenseId"))); label_licenseType.setText(config.getString("licenseType")); label_productName.setText(config.getString("productName")); label_companyName.setText(config.getString("companyName")); label_customerName.setText(config.getString("customerName")); label_version.setText(config.getString("version")); label_createDate.setText(config.getString("createDate")); label_expiredDate.setText(config.getString("expiredDate")); } catch (Exception e1) { // TODO Auto-generated catch block JOptionPane.showMessageDialog(e.getComponent(), e1.getMessage()); } try { LicenseManager.validateLicense(licenseFile.getAbsolutePath(), pubKeyFilePath); JOptionPane.showMessageDialog(e.getComponent(), "?"); } catch (LicenseException e1) { // TODO Auto-generated catch block JOptionPane.showMessageDialog(e.getComponent(), e1.getMessage()); } } }); GridBagConstraints gbc_button_2 = new GridBagConstraints(); gbc_button_2.gridx = 1; gbc_button_2.gridy = 10; this.add(button_2, gbc_button_2); }
From source file:org.apache.mahout.classifier.bayes.algorithm.CBayesAlgorithm.java
@Override public ClassifierResult classifyDocument(String[] document, Datastore datastore, String defaultCategory) throws InvalidDatastoreException { ClassifierResult result = new ClassifierResult(defaultCategory); double max = Double.MIN_VALUE; Collection<String> categories = datastore.getKeys("labelWeight"); for (String category : categories) { double prob = documentWeight(datastore, category, document); if (max < prob) { max = prob;//w ww . ja v a2 s . co m result.setLabel(category); } } result.setScore(max); return result; }
From source file:gate.termraider.output.CloudGenerator.java
private void findRange() { min = Double.MAX_VALUE;/*from w w w.ja v a2s . c om*/ max = Double.MIN_VALUE; for (Map.Entry<Term, ? extends Number> entry : termNumbers.entrySet()) { if ((languages == null || languages.contains(entry.getKey().getLanguageCode()) && (types == null || types.contains(entry.getKey().getType())))) { max = Math.max(max, entry.getValue().doubleValue()); min = Math.min(min, entry.getValue().doubleValue()); } } }
From source file:net.tradelib.core.TradeSummaryBuilder.java
public TradeSummaryBuilder(Series pnl) { numTrades = 0;/* w w w. ja va 2s . c o m*/ grossProfits = 0.0; grossLosses = 0.0; dailyPnlStats = new SummaryStatistics(); pnlStats = new SummaryStatistics(); nonZero = 0; positive = 0; negative = 0; maxWin = 0.0; maxLoss = 0.0; averageWinTrade = new Average(); averageLossTrade = new Average(); this.pnl = pnl; pnlId = 0; equity = 0.0; minEquity = Double.MAX_VALUE; maxEquity = Double.MIN_VALUE; maxDD = Double.MAX_VALUE; maxDDPct = Double.MAX_VALUE; }
From source file:org.joda.primitives.iterator.impl.TestArrayDoubleIterator.java
@Override public Iterator<Double> makeFullIterator() { double[] data = new double[] { new Double(2d), new Double(-2d), new Double(38.765d), new Double(0d), new Double(10000d), new Double(202d), new Double(Double.MIN_VALUE), new Double(Double.MAX_VALUE) }; return new ArrayDoubleIterator(data); }
From source file:com.golemgame.util.TransformationFunction.java
protected double transformValue(double x, UnivariateRealFunction function) throws FunctionEvaluationException { double tempY = scaleY; if (tempY == 0)//avoid division by zero. tempY = Double.MIN_VALUE; return (function.value((x - translateX) * scaleX) / scaleY + translateY); }
From source file:blue.soundObject.jmask.Quantizer.java
public Quantizer() { gridSizeTable.getPoint(0).setValue(1.0); gridSizeTable.getPoint(0).setValue(1.0); gridSizeTable.setMin(Double.MIN_VALUE, true); strengthTable.getPoint(0).setValue(1.0); strengthTable.getPoint(0).setValue(1.0); offsetTable.getPoint(0).setValue(0.0); offsetTable.getPoint(0).setValue(0.0); }
From source file:co.turnus.common.util.CommonDataUtil.java
public static <T> double maxOf(EMap<T, StatisticalData> map) { double val = Double.MIN_VALUE; for (Entry<T, StatisticalData> s : map.entrySet()) { val = FastMath.max(val, s.getValue().getMin()); }/*from ww w . j a v a 2 s . com*/ return val; }
From source file:com.versobit.weatherdoge.WeatherUtil.java
private static WeatherResult getWeatherFromYahoo(double latitude, double longitude, String location) { try {/*from www . jav a2 s. c o m*/ String yqlText; if (latitude == Double.MIN_VALUE && longitude == Double.MIN_VALUE) { if (location == null) { return new WeatherResult(null, WeatherResult.ERROR_THROWABLE, "No valid location parameters.", new IllegalArgumentException()); } yqlText = location.replaceAll("[^\\p{L}\\p{Nd} ,-]+", ""); } else { yqlText = String.valueOf(latitude) + ", " + String.valueOf(longitude); } URL url = new URL("https://query.yahooapis.com/v1/public/yql?q=" + URLEncoder.encode( "select location.city, units, item.condition, astronomy from weather.forecast where woeid in (select woeid from geo.placefinder where text = \"" + yqlText + "\" and gflags = \"R\" limit 1) limit 1", "UTF-8") + "&format=json"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); try { JSONObject response = new JSONObject(IOUtils.toString(connection.getInputStream())); if (connection.getResponseCode() != HttpsURLConnection.HTTP_OK) { JSONObject error = response.getJSONObject("error"); return new WeatherResult(null, WeatherResult.ERROR_API, error.getString("description"), null); } JSONObject query = response.getJSONObject("query"); if (query.getInt("count") == 0) { return new WeatherResult(null, WeatherResult.ERROR_API, "No results found for that location.", null); } JSONObject channel = query.getJSONObject("results").getJSONObject("channel"); JSONObject units = channel.getJSONObject("units"); JSONObject condition = channel.getJSONObject("item").getJSONObject("condition"); JSONObject astronomy = channel.getJSONObject("astronomy"); double temp = condition.getDouble("temp"); if ("F".equals(units.getString("temperature"))) { temp = (temp - 32d) * 5d / 9d; } String text = condition.getString("text"); String code = condition.getString("code"); String date = condition.getString("date"); String sunrise = astronomy.getString("sunrise"); String sunset = astronomy.getString("sunset"); String owmCode = convertYahooCode(code, date, sunrise, sunset); if (location == null || location.isEmpty()) { location = channel.getJSONObject("location").getString("city"); } return new WeatherResult(new WeatherData(temp, text, owmCode, latitude, longitude, location, new Date(), Source.YAHOO), WeatherResult.ERROR_NONE, null, null); } finally { connection.disconnect(); } } catch (Exception ex) { return new WeatherResult(null, WeatherResult.ERROR_THROWABLE, ex.getMessage(), ex); } }
From source file:com.opensymphony.xwork2.conversion.impl.StringConverterTest.java
public void testDoubleToStringConversionPL() throws Exception { // given//from w w w. ja v a 2s. c o m StringConverter converter = new StringConverter(); Map<String, Object> context = new HashMap<>(); context.put(ActionContext.LOCALE, new Locale("pl", "PL")); // when has max fraction digits Object value = converter.convertValue(context, null, null, null, Double.MIN_VALUE, null); // then does not lose fraction digits assertEquals("0," + StringUtils.repeat('0', 323) + "49", value); // when has max integer digits value = converter.convertValue(context, null, null, null, Double.MAX_VALUE, null); // then does not lose integer digits assertEquals("17976931348623157" + StringUtils.repeat('0', 292), value); // when cannot be represented exactly with a finite binary number value = converter.convertValue(context, null, null, null, 0.1d, null); // then produce the shortest decimal representation that can unambiguously identify the true value of the floating-point number assertEquals("0,1", value); }