|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFormattable
AbstractIdentifiedObject
AbstractParameterDescriptor
DefaultParameterDescriptorGroup
MatrixParameterDescriptors
public class MatrixParameterDescriptors
A parameter group for matrix elements. The amount of
parameter values is extensible, i.e. it can grown or
shrink according the value of "num_row"
and "num_col"
parameters. The parameters format may vary according the information provided to
the constructor, but it is typically as below:
num_row num_col elt_0_0 elt_0_1 ... elt_0_<num_col-1> elt_1_0 elt_1_1 ... elt_<num_row-1>_<num_col-1>
MatrixParameters
,
Serialized Form
modules/library/referencing (gt-referencing.jar)
Field Summary | |
---|---|
static int |
DEFAULT_MATRIX_SIZE
The default matrix size for the one-argument constructor. |
protected ParameterDescriptor<Integer> |
numCol
The descriptor for the "num_col" parameter. |
protected ParameterDescriptor<Integer> |
numRow
The descriptor for the "num_row" parameter. |
protected String |
prefix
The prefix to insert in front of parameter name for each matrix elements. |
protected char |
separator
The separator between the row and the column index in parameter names. |
Fields inherited from class AbstractIdentifiedObject |
---|
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR |
Fields inherited from class Formattable |
---|
SINGLE_LINE |
Fields inherited from interface IdentifiedObject |
---|
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY |
Constructor Summary | |
---|---|
MatrixParameterDescriptors(Map<String,?> properties)
Constructs a parameter group with default name format matching Well Known Text usages. |
|
MatrixParameterDescriptors(Map<String,?> properties,
ParameterDescriptor<?>[] parameters,
String prefix,
char separator)
Constructs a parameter group. |
Method Summary | |
---|---|
ParameterValueGroup |
createValue()
Creates a new instance of parameter values with elements initialized to the 1 on the diagonal, and 0 everywere else. |
ParameterDescriptor<Double> |
descriptor(int row,
int column)
Returns the parameter in this group for a matrix element at the specified index. row and column indices are 0 based. |
GeneralParameterDescriptor |
descriptor(String name)
Returns the parameter in this group for the specified name. |
List<GeneralParameterDescriptor> |
descriptors()
Returns the parameters in this group. |
boolean |
equals(AbstractIdentifiedObject object,
boolean compareMetadata)
Compares the specified object with this parameter group for equality. |
Matrix |
getMatrix(ParameterValueGroup parameters)
Constructs a matrix from a group of parameters. |
int |
hashCode()
Returns a hash value for this parameter. |
Methods inherited from class DefaultParameterDescriptorGroup |
---|
getMaximumOccurs |
Methods inherited from class AbstractParameterDescriptor |
---|
formatWKT, getMinimumOccurs |
Methods inherited from class AbstractIdentifiedObject |
---|
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches, nameMatches |
Methods inherited from class Formattable |
---|
toString, toWKT, toWKT, toWKT |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface GeneralParameterDescriptor |
---|
getMinimumOccurs |
Methods inherited from interface IdentifiedObject |
---|
getAlias, getIdentifiers, getName, getRemarks, toWKT |
Field Detail |
---|
public static final int DEFAULT_MATRIX_SIZE
protected final ParameterDescriptor<Integer> numRow
"num_row"
parameter.
protected final ParameterDescriptor<Integer> numCol
"num_col"
parameter.
protected final String prefix
protected final char separator
Constructor Detail |
---|
public MatrixParameterDescriptors(Map<String,?> properties)
properties
- Set of properties. Should contains at least "name"
.public MatrixParameterDescriptors(Map<String,?> properties, ParameterDescriptor<?>[] parameters, String prefix, char separator)
parameters
array should contains parameters other
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.
properties
- Set of properties. Should contains at least "name"
.parameters
- The "num_row"
and "num_col"
parameters.prefix
- The prefix to insert in front of parameter name for each matrix elements.separator
- The separator between the row and the column index in parameter names.Method Detail |
---|
public final GeneralParameterDescriptor descriptor(String name) throws ParameterNotFoundException
"elt_row_col"
where
"elt_"
is the prefix for all matrix elements, and row
and col are row and column indices respectively. For example "elt_2_1"
is the element name for the value at line 2 and row 1. The row and column index are 0 based.
descriptor
in interface ParameterDescriptorGroup
descriptor
in class DefaultParameterDescriptorGroup
name
- The case insensitive name of the parameter to search for.
ParameterNotFoundException
- if there is no parameter for the given name.public final ParameterDescriptor<Double> descriptor(int row, int column) throws IndexOutOfBoundsException
numRow
and numCol
parameters.
row
- The row indice.column
- The column indice
IndexOutOfBoundsException
- if row
or column
is out of bounds.public final List<GeneralParameterDescriptor> descriptors()
numRow
and numCol
parameters.
descriptors
in interface ParameterDescriptorGroup
descriptors
in class DefaultParameterDescriptorGroup
public ParameterValueGroup createValue()
numRow
and numCol
parameters.
createValue
in interface GeneralParameterDescriptor
createValue
in interface ParameterDescriptorGroup
createValue
in class DefaultParameterDescriptorGroup
public Matrix getMatrix(ParameterValueGroup parameters) throws InvalidParameterNameException
parameters
- The group of parameters.
InvalidParameterNameException
- if a parameter name was not recognized.public boolean equals(AbstractIdentifiedObject object, boolean compareMetadata)
equals
in class DefaultParameterDescriptorGroup
object
- The object to compare to this
.compareMetadata
- true
for performing a strict comparaison, or
false
for comparing only properties relevant to transformations.
true
if both objects are equal.public int hashCode()
hashCode
in class DefaultParameterDescriptorGroup
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |