/** * Constructs default values for the specified {@linkplain MatrixParameterDescriptors matrix * parameter descriptors}. * * @param descriptor The descriptor for this group of parameters. */ public MatrixParameters(final MatrixParameterDescriptors descriptor) { super(descriptor); numRow = Parameters.cast((ParameterValue) parameter(0), Integer.class); numCol = Parameters.cast((ParameterValue) parameter(1), Integer.class); }
/** * Constructs a parameter group. The properties map is given unchanged to the {@linkplain * AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. The {@code * parameters} array should contains parameters <strong>other</strong> than matrix elements. The * first parameter is assumed to be the number of rows, and the second parameter the number of * columns. All extra parameters are ignored. * * @param properties Set of properties. Should contains at least {@code "name"}. * @param parameters The {@code "num_row"} and {@code "num_col"} parameters. * @param prefix The prefix to insert in front of parameter name for each matrix elements. * @param separator The separator between the row and the column index in parameter names. */ public MatrixParameterDescriptors( final Map<String, ?> properties, ParameterDescriptor<?>[] parameters, final String prefix, final char separator) { super(properties, parameters); if (parameters.length < 2) { // TODO: provide a localized message throw new IllegalArgumentException(); } numRow = Parameters.cast(parameters[0], Integer.class); numCol = Parameters.cast(parameters[1], Integer.class); ensureNonNull("prefix", prefix); this.prefix = prefix; this.separator = separator; }