List of usage examples for org.apache.commons.lang NotImplementedException NotImplementedException
public NotImplementedException(Class clazz)
NotImplementedException
referencing the specified class. From source file:com.opengamma.analytics.financial.model.volatility.smile.function.SABRPaulotVolatilityFunction.java
@Override public Function1D<SABRFormulaData, Double> getVolatilityFunction(final EuropeanVanillaOption option, final double forward) { Validate.notNull(option, "option"); final double strike = option.getStrike(); final double cutoff = forward * CUTOFF_MONEYNESS; final double k; if (strike < cutoff) { s_logger.info("Given strike of " + strike + " is less than cutoff at " + cutoff + ", therefore the strike is taken as " + cutoff); k = cutoff;/* w ww . j a v a 2s.c o m*/ } else { k = strike; } final double t = option.getTimeToExpiry(); return new Function1D<SABRFormulaData, Double>() { @SuppressWarnings("synthetic-access") @Override public final Double evaluate(final SABRFormulaData data) { Validate.notNull(data, "data"); final double alpha = data.getAlpha(); final double beta = data.getBeta(); final double rho = data.getRho(); final double nu = data.getNu(); double sigma0, sigma1; final double beta1 = 1 - beta; final double x = Math.log(k / forward); if (CompareUtils.closeEquals(nu, 0, EPS)) { if (CompareUtils.closeEquals(beta, 1.0, EPS)) { return alpha; // this is just log-normal } throw new NotImplementedException("Have not implemented the case where nu = 0, beta != 0"); } // the formula behaves very badly close to ATM if (CompareUtils.closeEquals(x, 0.0, 1e-3)) { final double delta = 1.01e-3; final double a0 = (HAGAN.getVolatilityFunction(option, forward)).evaluate(data); double kPlus, kMinus; kPlus = forward * Math.exp(delta); kMinus = forward * Math.exp(-delta); EuropeanVanillaOption other = new EuropeanVanillaOption(kPlus, option.getTimeToExpiry(), option.isCall()); final double yPlus = getVolatilityFunction(other, forward).evaluate(data); other = new EuropeanVanillaOption(kMinus, option.getTimeToExpiry(), option.isCall()); final double yMinus = getVolatilityFunction(other, forward).evaluate(data); final double a2 = (yPlus + yMinus - 2 * a0) / 2 / delta / delta; final double a1 = (yPlus - yMinus) / 2 / delta; return a2 * x * x + a1 * x + a0; } final double tScale = nu * nu * t; final double alphaScale = alpha / nu; double q; if (CompareUtils.closeEquals(beta, 1.0, EPS)) { q = x; } else { q = (Math.pow(k, beta1) - Math.pow(forward, beta1)) / beta1; } final double vMin = Math.sqrt(alphaScale * alphaScale + 2 * rho * alphaScale * q + q * q); final double logTerm = Math.log((vMin + rho * alphaScale + q) / (1 + rho) / alphaScale); sigma0 = x / logTerm; final double cTilde = getCTilde(forward, k, alphaScale, beta, rho, q); sigma1 = -(cTilde + Math.log(sigma0 * Math.sqrt(k * forward))) / square(logTerm); return nu * sigma0 * (1 + sigma1 * tScale); } }; }
From source file:de.appsolve.padelcampus.controller.ranking.RankingController.java
@RequestMapping("{gender}/{category}/{date}") public ModelAndView getRanking(@PathVariable Gender gender, @PathVariable RankingCategory category, @PathVariable(required = false) LocalDate date) { ModelAndView mav = new ModelAndView(getPath() + "ranking/ranking"); mav.addObject("gender", gender); mav.addObject("category", category); List<Ranking> rankings = null; switch (category) { case individual: rankings = rankingUtil.getRanking(gender, date); break;// w w w . j a v a2 s .co m case team: rankings = rankingUtil.getTeamRanking(gender, date); break; default: throw new NotImplementedException("unsupported category"); } mav.addObject("Rankings", rankings); mav.addObject("path", getPath()); return mav; }
From source file:AIR.Common.DB.AbstractDLL.java
/** * @deprecated Please use fixDataBaseNames() instead. *///from w w w . jav a2 s . co m @Deprecated public String createDatabaseName(String db, String resource) { DATABASE_TYPE dbDialect = getDatabaseDialect(); switch (dbDialect) { case MYSQL: throw new NotImplementedException("MySQL support does not exist yet."); case SQLSERVER: if (StringUtils.isEmpty(db)) return TDSStringUtils.format("dbo.{0}", resource); else return TDSStringUtils.format("{0}.dbo.{1}", db, resource); default: throw new IllegalArgumentException("Value " + dbDialect.toString() + " is not supported."); } }
From source file:net.navasoft.madcoin.backend.services.vo.GenericFilteredFields.java
/** * Format field./*from w w w . j a v a2 s. com*/ * * @param fieldToFormat * the field to format * @param conditions * the conditions * @return the mandatory datatype * @throws FilterFieldsException * the filter fields exception * @since 27/07/2014, 06:48:59 PM */ public MandatoryDatatype formatField(Origin fieldToFormat, Object... conditions) throws FilterFieldsException { throw new NotImplementedException(getClass()); }
From source file:com.impetus.kundera.cache.ehcache.EhCacheWrapper.java
@Override public void evict(Class arg0) { // TODO Can we use Class with ehcache throw new NotImplementedException("TODO"); }
From source file:com.impetus.kundera.query.QueryImpl.java
@Override public Query setHint(String hintName, Object value) { throw new NotImplementedException("TODO"); }
From source file:com.feilong.framework.netpay.advance.AbstractPaymentAdvanceAdaptor.java
@Override public QueryResult getQueryResult(QueryRequest queryRequest) { // ??UnsupportedOperationException???? // NotImplementedException???TODO?catch? throw new NotImplementedException("getQueryResult is not implemented!"); }
From source file:AIR.Common.Web.Session.ContentLoggingHttpServletRequest.java
@Override public Enumeration<String> getParameterNames() { // TODO Need to implement parameters throw new NotImplementedException( "For proper function, parameter parsing must be implemented on ContentLoggingHttpServletRequest"); }
From source file:com.amalto.core.storage.prepare.JDBCStorageInitializer.java
private StorageInitializer getInitializer(Storage storage) { DataSource storageDataSource = storage.getDataSource(); if (!(storageDataSource instanceof RDBMSDataSource)) { throw new IllegalArgumentException("Storage to initialize does not seem to be a RDBMS storage."); }// www . j av a 2s .c om RDBMSDataSource dataSource = (RDBMSDataSource) storageDataSource; RDBMSDataSource.DataSourceDialect dialect = dataSource.getDialectName(); StorageInitializer jdbcStorageInitializer; switch (dialect) { case MYSQL: jdbcStorageInitializer = new MySQLStorageInitializer(); break; case H2: jdbcStorageInitializer = new H2StorageInitializer(); break; case ORACLE_10G: jdbcStorageInitializer = new OracleStorageInitializer(); break; case SQL_SERVER: jdbcStorageInitializer = new SQLServerStorageInitializer(); break; case POSTGRES: jdbcStorageInitializer = new PostgresStorageInitializer(); break; case DB2: jdbcStorageInitializer = new DB2StorageInitializer(); break; default: throw new NotImplementedException("Can not initialize storages based on dialect '" + dialect + "'"); } return new FullTextIndexCleaner(jdbcStorageInitializer); }
From source file:com.opengamma.analytics.financial.credit.CreditInstrumentDefinitionVisitorAdapter.java
@Override public RESULT_TYPE visitStandardVanillaCDS(final StandardVanillaCreditDefaultSwapDefinition cds) { throw new NotImplementedException( "This visitor (" + getClass().getName() + ") does not implement visitStandardVanillaCDS()"); }