Package org.jquantlib.lang.exceptions

Examples of org.jquantlib.lang.exceptions.LibraryException


                for (int i=0; i<3; i++) {
                    final Constructor<Object> c = getGenericParameterClass(i).getConstructor();
                    objs[i] = c.newInstance();
                }
            } catch (final Exception e) {
                throw new LibraryException(e);
            }
            return objs;
        }
View Full Code Here


        if (fixingDate.lt(today) || (fixingDate.equals(today) && enforceTodaysHistoricFixings && !forecastTodaysFixing)) {
            // must have been fixed
            try {
                return IndexManager.getInstance().get(name()).get(fixingDate);
            } catch (final Exception e) {
                throw new LibraryException("Missing fixing for " + fixingDate, e);
            }
        }

        if ((fixingDate.equals(today)) && !forecastTodaysFixing) {
            // might have been fixed
View Full Code Here

        case Daily:
            units = TimeUnit.Days;
            length = 1;
            break;
        default:
            throw new LibraryException(UNKNOWN_FREQUENCY); // QA:[RG]::verified
        }
    }
View Full Code Here

                            break;
                        case Weeks:
                        case Days:
                            throw new IllegalArgumentException(INCOMPATIBLE_TIME_UNIT);
                        default:
                            throw new LibraryException(UNKNOWN_TIME_UNIT);
                    }
                    break;
                case Months:
                    switch (another.units()) {
                        case Years:
                            this.length += another.length() * 12;
                            break;
                        case Weeks:
                        case Days:
                            throw new IllegalArgumentException(INCOMPATIBLE_TIME_UNIT);
                        default:
                            throw new LibraryException(UNKNOWN_TIME_UNIT);
                    }
                    break;
                case Weeks:
                    switch (another.units()) {
                        case Days:
                            this.units = another.units();
                            this.length = this.length*7 + another.length();
                            break;
                        case Years:
                        case Months:
                            throw new IllegalArgumentException(INCOMPATIBLE_TIME_UNIT);
                        default:
                            throw new LibraryException(UNKNOWN_TIME_UNIT);
                    }
                    break;
                case Days:
                    switch (another.units()) {
                        case Weeks:
                            this.length += another.length()*7;
                            break;
                        case Years:
                        case Months:
                            throw new IllegalArgumentException(INCOMPATIBLE_TIME_UNIT);
                        default:
                            throw new LibraryException(UNKNOWN_TIME_UNIT);
                    }
                    break;
                default:
                    throw new LibraryException(UNKNOWN_TIME_UNIT);
            }
        return this;
    }
View Full Code Here

            }

        if (this.length % scalar == 0)
            this.length = this.length/scalar;
        else
            throw new LibraryException("cannot be divided by " + scalar);

        return this;
    }
View Full Code Here

        if (period1MaxDays < period2MinDays)
            return true;
        else if (period1MinDays > period2MaxDays)
            return false;
        else
            throw new LibraryException(UNDECIDABLE_COMPARISON);
    }
View Full Code Here

            return BusinessDayConvention.Following;
        case Months:
        case Years:
            return BusinessDayConvention.ModifiedFollowing;
        default:
            throw new LibraryException("invalid time units"); // QA:[RG]::verified // TODO: message
        }
    }
View Full Code Here

           if (length==1)
               return Frequency.Daily;
           else
               return Frequency.OtherFrequency;
       default:
           throw new LibraryException(UNKNOWN_TIME_UNIT); // QA:[RG]::verified
       }
   }
View Full Code Here

            return false;
        case Months:
        case Years:
            return true;
        default:
            throw new LibraryException("invalid time units")// QA:[RG]::verified // TODO: message
        }
    }
View Full Code Here

        case Months:
          return p.length()/12.0;
        case Years:
          return p.length();
        default:
          throw new LibraryException(UNKNOWN_TIME_UNIT);
      }
    }
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.