Package org.jquantlib.lang.exceptions

Examples of org.jquantlib.lang.exceptions.LibraryException


      if (type==Option.Type.Call) {
            return (price-strike >= 0.0 ? price-secondStrike : 0.0);
        } else if (type==Option.Type.Put) {
            return (strike-price >= 0.0 ? secondStrike-price : 0.0);
        } else {
            throw new LibraryException(UNKNOWN_OPTION_TYPE); // QA:[RG]::verified
        }
    }
View Full Code Here


                case Call:
                    return Math.max(discountS - strike, 0.0);
                case Put:
                    return Math.max(strike - discountS, 0.0);
                default:
                    throw new LibraryException(unsupported_option_type); // QA:[RG]::verified
            }
        }

        final double /* @Real */sigma2 = sigma() * sigma();
        final double /* @Real */h = Math.sqrt(k() * k() + 2.0 * sigma2);
 
View Full Code Here

  public void accept(final TypedVisitor<Payoff> v) {
    final Visitor<Payoff> v1 = (v!=null) ? v.getVisitor(this.getClass()) : null;
    if (v1 != null) {
            v1.visit(this);
        } else {
            throw new LibraryException("null payoff visitor"); // QA:[RG]::verified //TODO: message
        }
  }
View Full Code Here

        return name();
    }

    @Override
    public final double get(final double price) /* @ReadOnly */ {
        throw new LibraryException("dummy payoff given");
    }
View Full Code Here

    if (type == Option.Type.Call)
            return (price - strike > 0.0) ? price : 0.0;
        else if (type == Option.Type.Put)
            return (strike - price > 0.0) ? price : 0.0;
        else
            throw new LibraryException("unknown/illegal option type"); // QA:[RG]::verified // TODO: message
  }
View Full Code Here

    public SampledCurve clone() {
        //XXX final SampledCurve result = new SampledCurve(this);
        try {
            return (SampledCurve) super.clone();
        } catch (final CloneNotSupportedException e) {
            throw new LibraryException(e);
        }
    }
View Full Code Here

            break;
        case Zero:
        case ThirdWednesday:
        case  Twentieth:
        case  TwentiethIMM:
            throw new LibraryException(reportFalseDateGenerationRule(stubDate, rule));
        default:
            throw new LibraryException("unknown DateGeneration.Rule"); // TODO: message
        }

        final Schedule schedule = new Schedule(startDate, maturityDate_, tenor,
                calendar_, accrualConvention, accrualConvention,
                rule, endOfMonth,
View Full Code Here

                fxMax=froot;
            } else if (sign(fxMax,froot) != fxMax) {
                xMin=root;
                fxMin=froot;
            } else
                throw new LibraryException("internal error"); // QA:[RG]::verified // TODO: message

            if (Math.abs(xMax-xMin) <= xAccuracy_)
                return root;
        }
        throw new ArithmeticException("maximum number of function evaluations exceeded"); // TODO: message
View Full Code Here

        case High:
            return this.high;
        case Low:
            return this.low;
        default:
            throw new LibraryException(UNKNOWN_PRICE_TYPE); // QA:[RG]::verified
        }
    }
View Full Code Here

            break;
        case Low:
            this.low = value;
            break;
        default:
            throw new LibraryException(UNKNOWN_PRICE_TYPE); // QA:[RG]::verified
        }
    }
View Full Code Here

TOP

Related Classes of org.jquantlib.lang.exceptions.LibraryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.