public class DefaultParameterDescriptorGroup extends AbstractIdentifiedObject implements ParameterDescriptorGroup
DefaultParameterDescriptorGroup
instances are immutable and thus thread-safe.
Each map projection or process will typically defines a single static ParameterDescriptorGroup
,
to be shared by all users of that projection or process.
ParameterBuilder
class for making
their task easier.
public class Mercator { public static final ParameterDescriptorGroup PARAMETERS; static { ParameterBuilder builder = new ParameterBuilder(); builder.setCodeSpace(Citations.OGP, "EPSG").setRequired(true); ParameterDescriptor<?>[] parameters = { builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, NonSI.DEGREE_ANGLE), builder.addName("Longitude of natural origin") .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE), builder.addName("Scale factor at natural origin").createStrictlyPositive(1, Unit.ONE), builder.addName("False easting") .create(0, SI.METRE), builder.addName("False northing") .create(0, SI.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); } }
ParameterValueGroup parameters = Mercator.PARAMETERS.createValue(); // See DefaultParameterValueGroup for examples on 'parameters' usage.
DefaultParameterValueGroup
,
DefaultParameterDescriptor
,
Serialized FormDefined in the sis-referencing
module
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.
|
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.
|
protected String |
formatTo(Formatter formatter)
Formats this group as a pseudo-Well Known Text element.
|
Class<? extends ParameterDescriptorGroup> |
getInterface()
Returns the GeoAPI interface implemented by this class.
|
int |
getMaximumOccurs()
The maximum number of times that values for this parameter group are required.
|
int |
getMinimumOccurs()
The minimum number of times that values for this parameter group or parameter are required.
|
void |
print()
Prints a string representation of this descriptor to the standard output stream.
|
String |
toString()
Returns a string representation of this descriptor.
|
castOrCopy, equals, getAlias, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
toString, toWKT
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() |
"remarks" | InternationalString or String |
AbstractIdentifiedObject.getRemarks() |
properties
- The properties to be given to the identified object.minimumOccurs
- The minimum number of times
that values for this parameter group are required.maximumOccurs
- The maximum number of times
that values for this parameter group are required.parameters
- The parameter descriptors for this group.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 AbstractIdentifiedObject
ParameterDescriptorGroup.class
or a user-defined sub-interface.public int getMinimumOccurs()
getMinimumOccurs
in interface GeneralParameterDescriptor
public int getMaximumOccurs()
getMaximumOccurs
in interface GeneralParameterDescriptor
public ParameterValueGroup createValue()
this
object.createValue
in interface GeneralParameterDescriptor
createValue
in interface ParameterDescriptorGroup
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 boolean equals(Object object, ComparisonMode mode)
equals
in interface LenientComparable
equals
in class AbstractIdentifiedObject
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
@Debug public String toString()
ParameterFormat
.
This method is for information purpose only and may change in future SIS version.
toString
in class FormattableObject
@Debug public void print()
This is a convenience method for debugging purpose and for console applications.
print
in class FormattableObject
protected String formatTo(Formatter formatter)
formatTo
in class AbstractIdentifiedObject
formatter
- The formatter where to format the inner content of this WKT element."ParameterGroup"
.FormattableObject.toWKT()
,
FormattableObject.toString()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.