001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-2012 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.parameter;
033    
034    import java.util.List;
035    import org.opengis.metadata.Identifier;
036    import org.opengis.annotation.UML;
037    
038    import static org.opengis.annotation.Obligation.*;
039    import static org.opengis.annotation.Specification.*;
040    
041    
042    /**
043     * The definition of a group of related parameters used by an operation method.
044     *
045     * @departure rename
046     *   GeoAPI uses a name which contains the "<code>Descriptor</code>" word for consistency with other
047     *   libraries in Java (e.g. <code>ParameterListDescriptor</code> in Java Advanced Imaging).
048     *
049     * @author  Martin Desruisseaux (IRD)
050     * @author  Jody Garnett (Refractions Research)
051     * @version 3.0
052     * @since   2.0
053     *
054     * @see ParameterValueGroup
055     * @see ParameterDescriptor
056     *
057     * @navassoc - - - GeneralParameterDescriptor
058     */
059    @UML(identifier="CC_OperationParameterGroup", specification=ISO_19111)
060    public interface ParameterDescriptorGroup extends GeneralParameterDescriptor {
061        /**
062         * Creates a new instance of {@linkplain ParameterValueGroup parameter value group}
063         * initialized with the {@linkplain ParameterDescriptor#getDefaultValue default values}.
064         * While not a requirement, the {@linkplain ParameterValueGroup#getDescriptor() parameter
065         * value descriptor} for the created group will typically be {@code this} descriptor instance.
066         * <p>
067         * The number of {@link ParameterValue} objects included must be between the
068         * {@linkplain ParameterDescriptor#getMinimumOccurs() minimum} and
069         * {@linkplain ParameterDescriptor#getMaximumOccurs() maximum occurences} required.
070         * For example:
071         * <p>
072         * <ul>
073         * <li>For {@link ParameterDescriptor} with cardinality 1:* a {@link ParameterValue} will
074         *     be included with the {@linkplain ParameterDescriptor#getDefaultValue() default value}
075         *     (even if this default value is null).</li>
076         * <li>For {@link ParameterDescriptor} with cardinality 0:* no entry is required.
077         *     {@link ParameterValue} entries may be created only as needed.</li>
078         * </ul>
079         *
080         * @return A new parameter instance initialized to the default value.
081         *
082         * @departure extension
083         *   This method is not part of the ISO specification. It is provided in GeoAPI as a kind of
084         *   factory method.
085         */
086        @Override
087        ParameterValueGroup createValue();
088    
089        /**
090         * Returns the parameters in this group.
091         *
092         * @return The parameter descriptors in this group.
093         */
094        @UML(identifier="parameter", obligation=MANDATORY, specification=ISO_19111)
095        List<GeneralParameterDescriptor> descriptors();
096    
097        /**
098         * Returns the parameter descriptor in this group for the specified
099         * {@linkplain Identifier#getCode identifier code}.
100         *
101         * @param  name The case insensitive {@linkplain Identifier#getCode() identifier code} of the
102         *              parameter to search for.
103         * @return The parameter for the given identifier code.
104         * @throws ParameterNotFoundException if there is no parameter for the given identifier code.
105         *
106         * @departure easeOfUse
107         *   This method is not part of the ISO specification. It has been added in an attempt to make
108         *   this interface easier to use.
109         */
110        GeneralParameterDescriptor descriptor(String name) throws ParameterNotFoundException;
111    }