/** * Constructs a parameter group wrapping the specified JAI parameters. A default {@link * ImagingParameterDescriptors} is created. * * @param properties Set of properties. Should contains at least {@code "name"}. * @param parameters The JAI's parameters. */ public ImagingParameters(final Map<String, ?> properties, final ParameterList parameters) { super(new ImagingParameterDescriptors(properties, parameters.getParameterListDescriptor())); this.parameters = parameters; ensureNonNull("parameters", parameters); }
/** * Returns the value in this group for the specified identifier code. Getter and setter methods * will use directly the JAI's {@linkplain #parameters parameter list} as the underlying backing * store, when applicable. * * @param name The case insensitive identifier code of the parameter to search for. * @return The parameter value for the given identifier code. * @throws ParameterNotFoundException if there is no parameter value for the given identifier * code. */ public synchronized ParameterValue parameter(String name) throws ParameterNotFoundException { ensureNonNull("name", name); name = name.trim(); final List<GeneralParameterValue> values = values(); final int size = values.size(); for (int i = 0; i < size; i++) { final ParameterValue value = (ParameterValue) values.get(i); if (AbstractIdentifiedObject.nameMatches(value.getDescriptor(), name)) { return value; } } throw new ParameterNotFoundException( Errors.format(ErrorKeys.MISSING_PARAMETER_$1, name), name); }