private final class CashOrNothingPayoffVisitor implements Visitor<Payoff> {
@Override
public final void visit(final Payoff o) {
final CashOrNothingPayoff payoff = (CashOrNothingPayoff)o;
black.alpha = black.dAlpha_dD1 = 0.0;
black.x = payoff.getCashPayoff();
black.dx_dStrike = 0.0;
final Option.Type optionType = payoff.optionType();
if (optionType == Option.Type.Call) {
black.beta = black.cum_d2;
black.dBeta_dD2 = black.n_d2;
} else if (optionType == Option.Type.Put) {
black.beta = 1.0 - black.cum_d2;