class ApproxForwardOvernightAveragedRateComputationFn implements RateComputationFn<OvernightAveragedRateComputation> {

  @Override
  public double rate(
      OvernightAveragedRateComputation computation,
      LocalDate startDate,
      LocalDate endDate,
      RatesProvider provider) {

    OvernightIndexRates rates = provider.overnightIndexRates(computation.getIndex());
    LocalDate valuationDate = rates.getValuationDate();
    LocalDate startFixingDate = computation.getStartDate();
    LocalDate startPublicationDate = computation.calculatePublicationFromFixing(startFixingDate);
    // No fixing to analyze. Go directly to approximation and cut-off.
    if (valuationDate.isBefore(startPublicationDate)) {
      return rateForward(computation, rates);
    }
    ObservationDetails details = new ObservationDetails(computation, rates);
    return details.calculateRate();
  }

  public  ApproxForwardOvernightAveragedRateComputationFn();

}