@Override public IborInterpolatedRateComputation build() { return new IborInterpolatedRateComputation( shortObservation, longObservation); }
/** * Creates an instance from the two underlying index observations. * <p> * The two observations must be for two different indexes in the same currency on the same fixing date. * The index with the shorter tenor must be passed as the first argument. * * @param shortObservation the short underlying index observation * @param longObservation the long underlying index observation * @return the rate computation * @throws IllegalArgumentException if the indices are not short, then long */ public static IborInterpolatedRateComputation of( IborIndexObservation shortObservation, IborIndexObservation longObservation) { return new IborInterpolatedRateComputation(shortObservation, longObservation); }
/** * Creates an instance from two indices and fixing date. * <p> * The indices may be passed in any order. * * @param index1 the first index * @param index2 the second index * @param fixingDate the fixing date * @param refData the reference data to use when resolving holiday calendars * @return the interpolated rate computation */ public static IborInterpolatedRateComputation of( IborIndex index1, IborIndex index2, LocalDate fixingDate, ReferenceData refData) { boolean inOrder = indicesInOrder(index1, index2, fixingDate); IborIndexObservation obs1 = IborIndexObservation.of(index1, fixingDate, refData); IborIndexObservation obs2 = IborIndexObservation.of(index2, fixingDate, refData); return new IborInterpolatedRateComputation(inOrder ? obs1 : obs2, inOrder ? obs2 : obs1); }