class EquityIndexOptionDefinition implements InstrumentDefinition<EquityIndexOption> {

  @Override
  public EquityIndexOption toDerivative(final ZonedDateTime date) {
    ArgumentChecker.notNull(date, "date");
    ArgumentChecker.inOrderOrEqual(date.toLocalDate(), getExpiryDate().toLocalDate(), "valuation date", "expiry");
    double timeToExpiry = TimeCalculator.getTimeBetween(date, getExpiryDate());
    if (timeToExpiry == 0) { // Day of expiration: Still time value if option has not expired.
      // REVIEW Stephen and Casey - This essentially assumes an Expiry with accuracy of 1 day.
      // The intended behaviour is that an option is still alive on the expiry date
      timeToExpiry = 0.0015; // Approximately half a day
    }
    double timeToSettlement = TimeCalculator.getTimeBetween(date, _settlementDate);
    if (timeToSettlement == 0) {
      timeToSettlement = 0.0015;
    }
    return new EquityIndexOption(timeToExpiry, timeToSettlement, _strike, _isCall, _currency, _pointValue, _exerciseType, _settlementType);
  }

  public  EquityIndexOptionDefinition(final boolean isCall, final double strike, final Currency currency, final ExerciseDecisionType exerciseType,
      final ZonedDateTime expiryDT, final LocalDate settlementDate, final double pointValue, final SettlementType settlementType);

}