Examples of GeneralParameterValue


Examples of org.opengis.parameter.GeneralParameterValue

     * mandatory parameter pending creation of the actual value, the value will be created now.
     */
    @Override
    public GeneralParameterValue get(int index) {
        ArgumentChecks.ensureValidIndex(size, index);
        GeneralParameterValue value = values[index];
        if (value instanceof UninitializedParameter) {
            values[index] = value = value.getDescriptor().createValue();
        }
        return value;
    }
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

     * be allowed by the cardinality constraints.
     */
    @Override
    public GeneralParameterValue set(final int index, final GeneralParameterValue parameter) {
        ArgumentChecks.ensureValidIndex(size, index);
        final GeneralParameterValue value = values[index];
        ArgumentChecks.ensureNonNull("parameter", parameter);
        final GeneralParameterDescriptor desc = parameter.getDescriptor();
        if (!value.getDescriptor().equals(desc)) {
            ensureDescriptorExists(desc);
            ensureCanRemove(desc);
            ensureCanAdd(desc);
        }
        values[index] = parameter;
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

         * Otherwise the given parameter will be added, in which case we need to check the cardinality.
         */
        final ReferenceIdentifier name = desc.getName();
        int count = 0;
        for (int i=0; i<size; i++) {
            final GeneralParameterValue value = values[i];
            if (name.equals(value.getDescriptor().getName())) {
                if (value instanceof UninitializedParameter) {
                    values[i] = parameter;
                    return true;
                }
                count++;
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

     * @return The value removed at the given index.
     */
    @Override
    public GeneralParameterValue remove(final int index) {
        ArgumentChecks.ensureValidIndex(size, index);
        final GeneralParameterValue value = values[index];
        ensureCanRemove(value.getDescriptor());
        System.arraycopy(values, index + 1, values, index, --size - index);
        values[size] = null;
        modCount++;
        return value;
    }
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

        super(descriptor);
        final List<GeneralParameterDescriptor> parameters = descriptor.descriptors();
        values = new ArrayList<GeneralParameterValue>(parameters.size());
        for (final GeneralParameterDescriptor element : parameters) {
            for (int count=element.getMinimumOccurs(); --count>=0;) {
                final GeneralParameterValue value = element.createValue();
                ensureNonNull("createValue", value);
                values.add(value);
            }
        }
    }
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

            throw new ParameterNotFoundException(Errors.format(
                      ErrorKeys.MISSING_PARAMETER_$1, name), name);
        }
        int count = 0;
        for (final Iterator it=values.iterator(); it.hasNext();) {
            final GeneralParameterValue value = (GeneralParameterValue) it.next();
            if (AbstractIdentifiedObject.nameMatches(value.getDescriptor(), name)) {
                count++;
            }
        }
        if (count >= check.getMaximumOccurs()) {
            throw new InvalidParameterCardinalityException(Errors.format(
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

         */
        List<Object> deferredGroups = null;
        final Object[] array1 = new Object[1];
        final Collection<?> elements = (values!=null) ? values.values() : group.descriptors();
        for (final Object element : elements) {
            final GeneralParameterValue      generalValue;
            final GeneralParameterDescriptor generalDescriptor;
            if (values != null) {
                generalValue = (GeneralParameterValue) element;
                generalDescriptor = generalValue.getDescriptor();
            } else {
                generalValue = null;
                generalDescriptor = (GeneralParameterDescriptor) element;
            }
            /*
 
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

         * in case of doubt.
         */
        Unit<?> unit = null;
        String warning = null;
        for (final Iterator<GeneralParameterValue> it=parameters.iterator(); it.hasNext();) {
            final GeneralParameterValue parameter = it.next();
            if (parameter instanceof ParameterValue) {
                final ParameterValue<?> value = (ParameterValue) parameter;
                final ParameterDescriptor<?> descriptor = value.getDescriptor();
                if (Number.class.isAssignableFrom(descriptor.getValueClass())) {
                    if (nameMatches(descriptor, "scale_factor")) {
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

    private static boolean parameterValuesEqual(final List<GeneralParameterValue> source,
                                                final List<GeneralParameterValue> target,
                                                final double errorTolerance)
    {
search: for (final Iterator<GeneralParameterValue> targetIter=target.iterator(); targetIter.hasNext();) {
            final GeneralParameterValue targetPrm = targetIter.next();
            for (final Iterator<GeneralParameterValue> sourceIter=source.iterator(); sourceIter.hasNext();) {
                final GeneralParameterValue sourcePrm = sourceIter.next();
                if (!nameMatches(sourcePrm.getDescriptor(), targetPrm.getDescriptor())) {
                    continue;
                }
                if (sourcePrm instanceof ParameterValue && targetPrm instanceof ParameterValue) {
                    final ParameterValue<?> sourceValue = (ParameterValue) sourcePrm;
                    final ParameterValue<?> targetValue = (ParameterValue) targetPrm;
View Full Code Here

Examples of org.opengis.parameter.GeneralParameterValue

        if (queryRect.isEmpty()) {
            return false;
        }

        final GridCoverage2DReader reader = sourceRef.get();
        GeneralParameterValue parameter = new Parameter(
                AbstractGridFormat.READ_GRIDGEOMETRY2D,
                new GridGeometry2D(new GridEnvelope2D(queryRect),
                reader.getOriginalGridToWorld(PixelInCell.CELL_CENTER),
                reader.getCoordinateReferenceSystem()));
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.