public class DefaultParameterDescriptorGroup extends AbstractParameterDescriptor implements ParameterDescriptorGroup
DefaultParameterDescriptorGroup
instances are immutable and thus thread-safe.
ParameterDescriptorGroup
needs to be instantiated directly,
then the ParameterBuilder
class may make the task easier.
class Mercator { static final ParameterDescriptorGroup PARAMETERS; static { ParameterBuilder builder = new ParameterBuilder(); builder.setCodeSpace(Citations.EPSG, "EPSG").setRequired(true); ParameterDescriptor<?>[] parameters = { builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, Units.DEGREE), builder.addName("Longitude of natural origin") .createBounded(-180, +180, 0, Units.DEGREE), builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Units.UNITY), builder.addName("False easting") .create(0, Units.METRE), builder.addName("False northing") .create(0, Units.METRE) }; builder.addIdentifier("9804") // Primary key in EPSG database. .addName("Mercator (variant A)") // EPSG name since October 2010. .addName("Mercator (1SP)") // EPSG name prior October 2010. .addName(Citations.OGC, "Mercator_1SP"); // Name found in some OGC specifications. PARAMETERS = builder.createGroup(parameters); } }
DefaultParameterValueGroup
,
DefaultParameterDescriptor
,
Serialized FormDefined in the sis-referencing
module
DEPRECATED_KEY, LOCALE_KEY
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Modifier | Constructor and Description |
---|---|
|
DefaultParameterDescriptorGroup(Map<String,?> properties,
int minimumOccurs,
int maximumOccurs,
GeneralParameterDescriptor... parameters)
Constructs a parameter group from a set of properties.
|
|
DefaultParameterDescriptorGroup(Map<String,?> properties,
ParameterDescriptorGroup parameters)
Constructs a group with the same parameters than another group.
|
protected |
DefaultParameterDescriptorGroup(ParameterDescriptorGroup descriptor)
Creates a new descriptor with the same values than the specified one.
|
Modifier and Type | Method and Description |
---|---|
static DefaultParameterDescriptorGroup |
castOrCopy(ParameterDescriptorGroup object)
Returns a SIS group implementation with the same values than the given arbitrary implementation.
|
protected long |
computeHashCode()
Invoked by
AbstractIdentifiedObject.hashCode() for computing the hash code when first needed. |
ParameterValueGroup |
createValue()
Creates a new instance of parameter value group
initialized with the default values.
|
GeneralParameterDescriptor |
descriptor(String name)
Returns the first parameter in this group for the specified name.
|
List<GeneralParameterDescriptor> |
descriptors()
Returns all parameters in this group.
|
boolean |
equals(Object object,
ComparisonMode mode)
Compares the specified object with this parameter group for equality.
|
Class<? extends ParameterDescriptorGroup> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
formatTo, getMaximumOccurs, getMinimumOccurs, print, toString
castOrCopy, equals, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
toString, toWKT
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getMaximumOccurs, getMinimumOccurs
getAlias, getIdentifiers, getName, getRemarks, toWKT
public DefaultParameterDescriptorGroup(Map<String,?> properties, int minimumOccurs, int maximumOccurs, GeneralParameterDescriptor... parameters)
Property name | Value type | Returned by |
---|---|---|
"name" | ReferenceIdentifier or String |
AbstractIdentifiedObject.getName() |
"alias" | GenericName or CharSequence (optionally as array) |
AbstractIdentifiedObject.getAlias() |
"identifiers" | ReferenceIdentifier (optionally as array) |
AbstractIdentifiedObject.getIdentifiers() |
"description" | InternationalString or String |
AbstractIdentifiedObject.getDescription() |
"remarks" | InternationalString or String |
AbstractIdentifiedObject.getRemarks() |
properties
- the properties to be given to the new parameter group.minimumOccurs
- the minimum number of times that values
for this parameter group are required, or 0 if no restriction.maximumOccurs
- the maximum number of times that values
for this parameter group are required, or Integer.MAX_VALUE
if no restriction.parameters
- the parameter descriptors for this group.InvalidParameterNameException
- if a parameter name is duplicated.public DefaultParameterDescriptorGroup(Map<String,?> properties, ParameterDescriptorGroup parameters)
properties
- the properties to be given to the new parameter group.parameters
- the existing group from which to copy the parameter descriptors.protected DefaultParameterDescriptorGroup(ParameterDescriptorGroup descriptor)
This constructor performs a shallow copy, i.e. the properties are not cloned.
descriptor
- the descriptor to shallow copy.castOrCopy(ParameterDescriptorGroup)
public static DefaultParameterDescriptorGroup castOrCopy(ParameterDescriptorGroup object)
null
, then this method returns null
.
Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged.
Otherwise a new SIS implementation is created and initialized to the values of the given object.object
- the object to get as a SIS implementation, or null
if none.null
if the argument was null.public Class<? extends ParameterDescriptorGroup> getInterface()
ParameterDescriptorGroup.class
.
ParameterDescriptorGroup
sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their own
set of interfaces.getInterface
in class AbstractParameterDescriptor
ParameterDescriptorGroup.class
or a user-defined sub-interface.public List<GeneralParameterDescriptor> descriptors()
descriptors
in interface ParameterDescriptorGroup
public GeneralParameterDescriptor descriptor(String name) throws ParameterNotFoundException
descriptor
in interface ParameterDescriptorGroup
name
- the name of the parameter to search for.ParameterNotFoundException
- if there is no parameter for the given name.public ParameterValueGroup createValue()
this
object.createValue
in interface GeneralParameterDescriptor
createValue
in interface ParameterDescriptorGroup
public boolean equals(Object object, ComparisonMode mode)
equals
in interface LenientComparable
equals
in class AbstractParameterDescriptor
object
- the object to compare to this
.mode
- the strictness level of the comparison.true
if both objects are equal according the given comparison mode.AbstractIdentifiedObject.computeHashCode()
,
Utilities.deepEquals(Object, Object, ComparisonMode)
protected long computeHashCode()
AbstractIdentifiedObject.hashCode()
for computing the hash code when first needed.computeHashCode
in class AbstractIdentifiedObject
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.