use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class NormalizedProjection method getParameterDescriptors.
/**
* Returns a description of the non-linear internal parameters of this {@code NormalizedProjection}.
* The returned group contains at least a descriptor for the {@link #eccentricity} parameter.
* Subclasses may add more parameters.
*
* <p>This method is for inspecting the parameter values of this non-linear kernel only,
* not for inspecting the {@linkplain #getContextualParameters() contextual parameters}.
* Inspecting the kernel parameter values is usually for debugging purpose only.</p>
*
* @return a description of the internal parameters.
*/
@Debug
@Override
public ParameterDescriptorGroup getParameterDescriptors() {
Class<?> type = getClass();
while (!Modifier.isPublic(type.getModifiers())) {
type = type.getSuperclass();
}
ParameterDescriptorGroup group;
synchronized (DESCRIPTORS) {
group = DESCRIPTORS.get(type);
if (group == null) {
final ParameterBuilder builder = new ParameterBuilder().setRequired(true);
if (type.getName().startsWith(Modules.CLASSNAME_PREFIX)) {
builder.setCodeSpace(Citations.SIS, Constants.SIS);
}
final String[] names = getInternalParameterNames();
final ParameterDescriptor<?>[] parameters = new ParameterDescriptor<?>[names.length + 1];
parameters[0] = MapProjection.ECCENTRICITY;
for (int i = 1; i < parameters.length; i++) {
parameters[i] = builder.addName(names[i - 1]).create(Double.class, null);
}
group = builder.addName(CharSequences.camelCaseToSentence(type.getSimpleName()) + " (radians domain)").createGroup(1, 1, parameters);
DESCRIPTORS.put(type, group);
}
}
return group;
}
use of org.apache.sis.parameter.ParameterBuilder in project sis by apache.
the class EllipsoidToCentricTransform method getParameterDescriptors.
/**
* Returns a description of the internal parameters of this {@code EllipsoidToCentricTransform} transform.
* The returned group contains parameter descriptors for the number of dimensions and the eccentricity.
*
* @return a description of the internal parameters.
*/
@Debug
@Override
public ParameterDescriptorGroup getParameterDescriptors() {
synchronized (EllipsoidToCentricTransform.class) {
if (DESCRIPTOR == null) {
final ParameterBuilder builder = new ParameterBuilder().setCodeSpace(Citations.SIS, Constants.SIS);
final ParameterDescriptor<TargetType> target = builder.setRequired(true).addName("target").create(TargetType.class, TargetType.CARTESIAN);
DESCRIPTOR = builder.addName("Ellipsoid (radians domain) to centric").createGroup(1, 1, ECCENTRICITY, target, DIMENSION);
}
return DESCRIPTOR;
}
}
Aggregations