Package org.jquantlib.lang.exceptions

Examples of org.jquantlib.lang.exceptions.LibraryException


    protected T getInstance(final Class<T> clazz, final GeneralizedBlackScholesProcess process) {
        try {
            return clazz.getConstructor(GeneralizedBlackScholesProcess.class).newInstance(process);
        } catch (final Exception e) {
            throw new LibraryException(e); // QA:[RG]::verified
        }
    }
View Full Code Here


            throw new UnsupportedOperationException();
        else if (classT == ZeroYield.class)
            //TODO: this.baseCurve = new InterpolatedZeroCurve(referenceDate, dayCounter, classI);
            throw new UnsupportedOperationException();
        else
            throw new LibraryException("only Discount, ForwardRate and ZeroYield are supported"); // TODO: message
    }
View Full Code Here

            throw new UnsupportedOperationException();
        else if (classT == ZeroYield.class)
            //TODO: this.baseCurve = new InterpolatedZeroCurve(settlementDays, calendar, dayCounter, classT);
            throw new UnsupportedOperationException();
        else
            throw new LibraryException("only Discount, ForwardRate and ZeroYield are supported"); // TODO: message
    }
View Full Code Here

    static private Traits constructTraits(final Class<?> classT) {
        if (Traits.class.isAssignableFrom(classT)) {
            try {
                return (Traits) classT.newInstance();
            } catch (final Exception e) {
                throw new LibraryException("could not instantiate Traits", e); // TODO: message
            }
        }

        throw new LibraryException("not a Traits"); // TODO: message
    }
View Full Code Here

    static private Interpolator constructInterpolator(final Class<?> classI) {
        if (Interpolator.class.isAssignableFrom(classI)) {
            try {
                return (Interpolator) classI.newInstance();
            } catch (final Exception e) {
                throw new LibraryException("could not instantiate Interpolator", e); // TODO: message
            }
        }

        throw new LibraryException("not an Interpolator"); // TODO: message
    }
View Full Code Here

        if (Bootstrap.class.isAssignableFrom(classB)) {
            try {
                final Constructor<Bootstrap> c = (Constructor<Bootstrap>) classB.getConstructor(Class.class);
                return c.newInstance(PiecewiseCurve.class);
            } catch (final Exception e) {
                throw new LibraryException("could not instantiate Bootstrap", e); // TODO: message
            }
        }

        throw new LibraryException("not a Bootstrap"); // TODO: message
    }
View Full Code Here

            final RateHelper helper,
            final int segment) {
        QL.validateExperimentalMode();

        if (!Traits.class.isAssignableFrom(traits.getClass())) {
            throw new LibraryException(ReflectConstants.WRONG_ARGUMENT_TYPE);
        }

        this.traits = traits;
        this.curve = c;
        this.segment = segment;
View Full Code Here

    // static private methods
    //

    static private Traits constructTraits(final Class<?> klass) {
        if (klass==null) {
            throw new LibraryException("null Traits"); // TODO: message
        }
        if (klass!=Traits.class) {
            throw new LibraryException(ReflectConstants.WRONG_ARGUMENT_TYPE);
        }

        try {
            return (Traits) klass.newInstance();
        } catch (final Exception e) {
            throw new LibraryException("cannot create Traits", e); // TODO: message
        }
    }
View Full Code Here

    public void accept(final TypedVisitor<BootstrapHelper> v) {
        final Visitor<BootstrapHelper> v1 = (v!=null) ? v.getVisitor(this.getClass()) : null;
        if (v1 != null) {
            v1.visit(this);
        } else {
            throw new LibraryException("not a bootstrap helper visitor");//TODO: message
        }
    }
View Full Code Here

            /*@DiscountFactor*/ final double discount1 = discount(d1, extrapolate);
            /*@DiscountFactor*/ final double discount2 = discount(d2, extrapolate);
            /*@CompoundFactor*/ final double compound = discount1 / discount2;
            return InterestRate.impliedRate(compound, d1, d2, dayCounter, comp, freq);
        } else
            throw new LibraryException("d1 later than d2"); // QA:[RG]::verified // TODO: message
    }
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.