List of usage examples for java.lang Number intValue
public abstract int intValue();
From source file:com.opengamma.financial.analytics.volatility.surface.BloombergIRFuturePriceCurveInstrumentProvider.java
@Override /**//www. j a va 2 s . co m * Provides ExternalID for Bloomberg ticker, eg EDZ3 Comdty, * given a reference date and an integer offset, the n'th subsequent future * The format is _futurePrefix + month + year + _postfix * <p> * Note that midcurve options are written on underlying futures that expire some number of quarters after the option's expiry. * The logic of this is based on the _futurePrefix. * <p> * @param futureNumber n'th future following curve date * @param curveDate date of curve validity; valuation date */ public ExternalId getInstrument(final Number futureNumber, final LocalDate curveDate) { final StringBuffer ticker = new StringBuffer(); ticker.append(_futurePrefix); // nQuartersDelay is used to handle mid-curve options int nQuartersDelay = 0; if ("0R".equals(_futurePrefix)) { nQuartersDelay = 4; } ticker.append(BloombergFutureUtils.getQuarterlyExpiryCodeForFutures(_futurePrefix, futureNumber.intValue() + nQuartersDelay, curveDate)); ticker.append(" "); ticker.append(_postfix); return ExternalId.of(ExternalScheme.of(_tickerScheme), ticker.toString()); }
From source file:gisintegration.SimpleSwingBrowser.java
private void createScene() { Platform.runLater(new Runnable() { @Override/* www .ja v a 2s. com*/ public void run() { WebView view = new WebView(); engine = view.getEngine(); // engine.titleProperty().addListener(new ChangeListener<String>() { // @Override // public void changed(ObservableValue<? extends String> observable, String oldValue, final String newValue) { // SwingUtilities.invokeLater(new Runnable() { // @Override // public void run() { // SimpleSwingBrowser.this.setTitle(newValue); // } // }); // } // }); engine.setOnStatusChanged(new EventHandler<WebEvent<String>>() { @Override public void handle(final WebEvent<String> event) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { lblStatus.setText(event.getData()); } }); } }); // engine.locationProperty().addListener(new ChangeListener<String>() { // @Override // public void changed(ObservableValue<? extends String> ov, String oldValue, final String newValue) { // SwingUtilities.invokeLater(new Runnable() { // @Override // public void run() { // txtURL.setText(newValue); // } // }); // } // }); engine.getLoadWorker().workDoneProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observableValue, Number oldValue, final Number newValue) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { progressBar.setValue(newValue.intValue()); } }); } }); engine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() { public void changed(ObservableValue<? extends Throwable> o, Throwable old, final Throwable value) { if (engine.getLoadWorker().getState() == FAILED) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(panel, (value != null) ? engine.getLocation() + "\n" + value.getMessage() : engine.getLocation() + "\nUnexpected error.", "Loading error...", JOptionPane.ERROR_MESSAGE); } }); } } }); jfxPanel.setScene(new Scene(view)); } }); }
From source file:com.prowidesoftware.swift.model.field.Field99B.java
/** * Set the component2 from a Number object. * <br />// w w w .j a v a 2 s. c om * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field99B setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field99C.java
/** * Set the component2 from a Number object. * <br />// w ww .j a va 2 s. c o m * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field99C setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }
From source file:de.tuberlin.uebb.jbop.optimizer.utils.NodeHelper.java
public static Number cast(final Number number, final AbstractInsnNode numberNode, final AbstractInsnNode castNode) { if (castNode == null) { return null; }/*from w ww. ja va 2 s.c o m*/ if (castNode == numberNode) { return number; } final int opcode = castNode.getOpcode(); if (opcode == I2B) { return (byte) number.intValue(); } // if(opcode==I2C) { // return (char)number.intValue(); // } if (opcode == I2L) { return (long) number.intValue(); } if (opcode == I2S) { return (short) number.intValue(); } if (opcode == I2D) { return (double) number.intValue(); } if (opcode == I2F) { return (float) number.intValue(); } if (opcode == D2F) { return (float) number.doubleValue(); } if (opcode == D2I) { return (int) number.doubleValue(); } if (opcode == D2L) { return (long) number.doubleValue(); } if (opcode == F2D) { return (double) number.floatValue(); } if (opcode == F2I) { return (int) number.floatValue(); } if (opcode == F2L) { return (long) number.floatValue(); } if (opcode == L2D) { return (long) number.longValue(); } if (opcode == L2F) { return (float) number.longValue(); } if (opcode == L2I) { return (int) number.longValue(); } return number; }
From source file:com.prowidesoftware.swift.model.field.Field28D.java
/** * Set the component1 from a Number object. * <br />/* ww w . ja v a 2 s . co m*/ * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent1(String) * method. * * @see #setComponent1(String) * * @param component1 the Number with the component1 content to set */ public Field28D setComponent1(java.lang.Number component1) { if (component1 != null) { setComponent(1, "" + component1.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field28D.java
/** * Set the component2 from a Number object. * <br />//from w ww.j ava2 s . c om * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field28D setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }
From source file:com.pureinfo.srm.reports.table.data.institute.Index3Statitistic.java
/** * @see com.pureinfo.srm.reports.table.data.institute.InstituteReportBase#buildDatas(boolean, * boolean)/*from www .j a v a2 s . c o m*/ */ public Object[][] buildDatas(boolean _bAscOrder, boolean _bOrderByValue) throws PureException { IObjects results = doMyQuery(); initOrgDatas(); Object[][] datas = new Object[m_nTableHight][TABEL_WIDTH]; for (int i = 0; i < TITLE_HEIGHT; i++) { for (int j = 0; j < datas[i].length; j++) { datas[i][j] = ""; } } datas[0][0] = ""; datas[0][IDX_SCI] = "SCI"; datas[0][IDX_EI] = "EI"; datas[0][IDX_ISTP] = "ISTP"; datas[1] = new String[] { "", "", "", "", "TOP", "", "", "", "", "", "" }; for (int i = 0; i < datas[2].length; i++) { datas[2][i] = null; } datas[2][IDX_SCI_3KIND_TOTAL] = ""; datas[2][IDX_SCI_3KIND_IF] = "IF"; datas[m_nTableHight - 1][0] = ""; datas[m_nTableHight - 2][0] = ""; DolphinObject result = null; for (Iterator iter = m_collges.entrySet().iterator(); iter.hasNext();) { Map.Entry en = (Map.Entry) iter.next(); Integer iId = (Integer) en.getKey(); Organization org = (Organization) en.getValue(); Integer idxCol = (Integer) m_orgIdxes.get(iId); Integer idxColOther = (Integer) m_orgIdxes.get(new Integer(-iId.intValue())); datas[idxCol.intValue()][0] = org.getCode() + ""; datas[idxColOther.intValue()][0] = org.getCode() + ""; } for (Iterator iter = m_institutes.entrySet().iterator(); iter.hasNext();) { Map.Entry en = (Map.Entry) iter.next(); Integer iId = (Integer) en.getKey(); Organization org = (Organization) en.getValue(); Integer idxIns = (Integer) m_orgIdxes.get(iId); datas[idxIns.intValue()][0] = org.getCode(); datas[idxIns.intValue()][1] = org.getName(); } while ((result = results.next()) != null) { Integer iDept = result.getIntegerProperty(DEPARTMENT); if (m_institutes.containsKey(iDept)) { Integer iIdxIns = (Integer) m_orgIdxes.get(iDept); Integer iCol = (Integer) m_InsColMap.get(iDept); Integer iIdxCol = (Integer) m_orgIdxes.get(iCol); add(datas[iIdxIns.intValue()], result); add(datas[iIdxCol.intValue()], result); } else if (m_collges.containsKey(iDept)) { Integer iIdxIns = (Integer) m_orgIdxes.get(new Integer(-iDept.intValue())); Integer iIdxCol = (Integer) m_orgIdxes.get(iDept); add(datas[iIdxIns.intValue()], result); add(datas[iIdxCol.intValue()], result); } else { Integer iIdxCol = (Integer) m_orgIdxes.get(IDX_OTHER); add(datas[iIdxCol.intValue()], result); } Integer iIdxCol = (Integer) m_orgIdxes.get(IDX_TOTAL); add(datas[iIdxCol.intValue()], result); } for (int i = TITLE_HEIGHT; i < datas.length; i++) { if (datas[i][IDX_SCI_3KIND_IF] == null) continue; if (datas[i][IDX_SCI_3KIND_TOTAL] == null) { datas[i][IDX_SCI_3KIND_IF] = null; continue; } Number iTotal = (Number) datas[i][IDX_SCI_3KIND_TOTAL]; Double oSum = (Double) datas[i][IDX_SCI_3KIND_IF]; if (iTotal.intValue() == 0) { datas[i][IDX_SCI_3KIND_IF] = null; } else { datas[i][IDX_SCI_3KIND_IF] = NUM_FORMAT.format(oSum.doubleValue() / iTotal.intValue()); } } return datas; }
From source file:com.prowidesoftware.swift.model.field.Field332.java
/** * Set the component1 from a Number object. * <br />//ww w .j a v a2 s .c om * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent1(String) * method. * * @see #setComponent1(String) * * @param component1 the Number with the component1 content to set */ public Field332 setComponent1(java.lang.Number component1) { if (component1 != null) { setComponent(1, "" + component1.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field332.java
/** * Set the component2 from a Number object. * <br />//from www. j ava 2 s . c om * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field332 setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }