/** * Creates a new coordinate operation with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. * * @see #castOrCopy(PassThroughOperation) */ protected DefaultPassThroughOperation(final PassThroughOperation operation) { super(operation); this.operation = operation.getOperation(); }
/** * Validates the given "pass through" operation. * * @param object the object to validate, or {@code null}. */ public void validate(final PassThroughOperation object) { if (object == null) { return; } validateCoordinateOperation(object); final MathTransform transform = object.getMathTransform(); mandatory("PassThroughOperation: shall have a MathTransform.", transform); final CoordinateOperation operation = object.getOperation(); mandatory("PassThroughOperation: getOperation() is mandatory.", operation); assertNotSame("PassThroughOperation: getOperation() can't be this.", object, operation); dispatch(operation); final int[] index = object.getModifiedCoordinates(); mandatory("PassThroughOperation: modified coordinates are mandatory.", index); if (operation == null || index == null) { return; } final int sourceDimension = transform.getSourceDimensions(); for (int i : index) { assertBetween("PassThroughOperation: invalid modified ordinate index.", 0, sourceDimension-1, i); } }
final MathTransform transform = object.getMathTransform(); mandatory("PassThroughOperation: shall have a MathTransform.", transform); final SingleOperation operation = object.getOperation(); mandatory("PassThroughOperation: getOperation() is mandatory.", operation); assertNotSame("PassThroughOperation: getOperation() can't be this.", object, operation); dispatch(operation); final int[] index = object.getModifiedCoordinates(); mandatory("PassThroughOperation: modified coordinates are mandatory.", index); if (operation == null || index == null) {
/** * Creates a new coordinate operation with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. * * @see #castOrCopy(PassThroughOperation) */ protected DefaultPassThroughOperation(final PassThroughOperation operation) { super(operation); this.operation = operation.getOperation(); }
/** * Compares this concatenated operation with the specified object for equality. If the {@code mode} argument * is {@link ComparisonMode#STRICT} or {@link ComparisonMode#BY_CONTRACT BY_CONTRACT}, then all available * properties are compared including the {@linkplain #getDomainOfValidity() domain of validity} and the * {@linkplain #getScope() scope}. * * @return {@inheritDoc} */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; // Slight optimization. } if (super.equals(object, mode)) { if (mode == ComparisonMode.STRICT) { return Objects.equals(operation, ((DefaultPassThroughOperation) object).operation); } else { return deepEquals(getOperation(), ((PassThroughOperation) object).getOperation(), mode); } } return false; }
/** * Compares this concatenated operation with the specified object for equality. If the {@code mode} argument * is {@link ComparisonMode#STRICT} or {@link ComparisonMode#BY_CONTRACT BY_CONTRACT}, then all available * properties are compared including the {@linkplain #getDomainOfValidity() domain of validity} and the * {@linkplain #getScope() scope}. * * @return {@inheritDoc} */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; // Slight optimization. } if (super.equals(object, mode)) { if (mode == ComparisonMode.STRICT) { return Objects.equals(operation, ((DefaultPassThroughOperation) object).operation); } else { return deepEquals(getOperation(), ((PassThroughOperation) object).getOperation(), mode); } } return false; }
/** * Invoked by JAXB at unmarshalling time for storing the result temporarily. * * @param operation the unmarshalled element. */ public void setElement(final AbstractCoordinateOperation operation) { metadata = operation; /* * In an older ISO 19111 model, PassThroughOperation extended SingleOperation. * It was forcing us to provide a dummy value or null for the 'method' property. * This has been fixed in newer ISO 19111 model, but for safety with object following the older model * (e.g. when using GeoAPI 3.0) we are better to skip the check for the SingleOperation case when the * operation is a PassThroughOperation. */ if (operation instanceof PassThroughOperation) { if (((PassThroughOperation) operation).getOperation() == null) { incomplete("coordOperation"); } } else if ((operation instanceof SingleOperation) && ((SingleOperation) operation).getMethod() == null) { incomplete("method"); } } }
/** * Invoked by JAXB at unmarshalling time for storing the result temporarily. * * @param operation the unmarshalled element. */ public void setElement(final AbstractCoordinateOperation operation) { metadata = operation; /* * In an older ISO 19111 model, PassThroughOperation extended SingleOperation. * It was forcing us to provide a dummy value or null for the 'method' property. * This has been fixed in newer ISO 19111 model, but for safety with object following the older model * (e.g. when using GeoAPI 3.0) we are better to skip the check for the SingleOperation case when the * operation is a PassThroughOperation. */ if (operation instanceof PassThroughOperation) { if (((PassThroughOperation) operation).getOperation() == null) { incomplete("coordOperation"); } } else if ((operation instanceof SingleOperation) && ((SingleOperation) operation).getMethod() == null) { incomplete("method"); } } }
printOperations(((PassThroughOperation) step).getOperation(), false); } else if (step instanceof SingleOperation) { outHeader.append(((SingleOperation) step).getMethod().getName().getCode());