private AbstractContrastMethodStrategy parseContrastEnhancementMethod( ContrastMethod method, Map<String, Expression> options) { String name = method.name().toUpperCase(); AbstractContrastMethodStrategy ceMethod = null; if ("NORMALIZE".equals(name)) { Expression algorithm = options.get(AbstractContrastMethodStrategy.ALGORITHM); ceMethod = new NormalizeContrastMethodStrategy(); if (algorithm != null) { ceMethod.setAlgorithm(algorithm); } } else if ("LOGARITHMIC".equalsIgnoreCase(name)) { ceMethod = new LogarithmicContrastMethodStrategy(); } else if ("EXPONENTIAL".equalsIgnoreCase(name)) { ceMethod = new ExponentialContrastMethodStrategy(); } else if ("HISTOGRAM".equalsIgnoreCase(name)) { ceMethod = new HistogramContrastMethodStrategy(); } else { throw new IllegalArgumentException( Errors.format(ErrorKeys.UNSUPPORTED_METHOD_$1, method)); } ceMethod.setOptions(options); return ceMethod; }