Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java?rev=1779702&r1=1779701&r2=1779702&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java [UTF-8] Sat Jan 21 08:49:49 2017
@@ -16,10 +16,11 @@
*/
package org.apache.sis.referencing.operation.matrix;
+import java.util.Objects;
import org.opengis.geometry.Envelope;
import org.opengis.geometry.DirectPosition;
import org.opengis.referencing.cs.AxisDirection;
-import org.opengis.referencing.cs.CoordinateSystem; // For javadoc
+import org.opengis.referencing.cs.CoordinateSystem; // For javadoc
import org.opengis.referencing.operation.Matrix;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.geometry.MismatchedDimensionException;
@@ -34,9 +35,6 @@ import org.apache.sis.internal.metadata.
import org.apache.sis.internal.referencing.Resources;
import org.apache.sis.internal.referencing.ExtendedPrecisionMatrix;
-// Branch-dependent imports
-import java.util.Objects;
-
/**
* {@link Matrix} factory methods and utilities.
@@ -96,10 +94,10 @@ public final class Matrices extends Stat
* {@value org.apache.sis.referencing.operation.matrix.Matrix4#SIZE} inclusive, the matrix
* is guaranteed to be an instance of one of {@link Matrix1} … {@link Matrix4} subtypes.
*
- * @param size Numbers of row and columns. For an affine transform matrix, this is the number of
+ * @param size numbers of row and columns. For an affine transform matrix, this is the number of
* {@linkplain MathTransform#getSourceDimensions() source} and
* {@linkplain MathTransform#getTargetDimensions() target} dimensions + 1.
- * @return An identity matrix of the given size.
+ * @return an identity matrix of the given size.
*/
public static MatrixSIS createIdentity(final int size) {
switch (size) {
@@ -271,8 +269,10 @@ public final class Matrices extends Stat
*/
final boolean same = srcDir.equals(dstDir);
if (useEnvelopes) {
- // See the comment in transform(Envelope, Envelope) for an explanation about why
- // we use the lower/upper corners instead than getMinimum()/getMaximum() methods.
+ /*
+ * See the comment in transform(Envelope, Envelope) for an explanation about why
+ * we use the lower/upper corners instead than getMinimum()/getMaximum() methods.
+ */
final DoubleDouble scale = new DoubleDouble(same ? +1 : -1, 0);
scale.multiply(dstEnvelope.getSpan(dstIndex));
scale.divide (srcEnvelope.getSpan(srcIndex));
@@ -544,7 +544,7 @@ public final class Matrices extends Stat
* @param sourceDimensions the number of dimensions in source coordinates.
* @param selectedDimensions the 0-based indices of source ordinate values to keep.
* The length of this array will be the number of dimensions in target coordinates.
- * @return An affine transform matrix keeping only the given source dimensions, and discarding all others.
+ * @return an affine transform matrix keeping only the given source dimensions, and discarding all others.
* @throws IllegalArgumentException if a value of {@code selectedDimensions} is lower than 0
* or not smaller than {@code sourceDimensions}.
*
@@ -1075,13 +1075,13 @@ public final class Matrices extends Stat
public static String toString(final Matrix matrix) {
final int numRow = matrix.getNumRow();
final int numCol = matrix.getNumCol();
- final String[] elements = new String [numCol * numRow]; // String representation of matrix values.
- final boolean[] noFractionDigits = new boolean[numCol * numRow]; // Whether to remove the trailing ".0" for a given number.
- final boolean[] hasDecimalSeparator = new boolean[numCol]; // Whether the column has at least one number where fraction digits are shown.
- final byte[] maximumFractionDigits = new byte [numCol]; // The greatest amount of fraction digits found in a column.
- final byte[] maximumPaddingZeros = new byte [numCol * numRow]; // Maximal amount of zeros that we can append before to exceed the IEEE 754 accuracy.
- final byte[] widthBeforeFraction = new byte [numCol]; // Number of characters before the fraction digits: spacing + ('-') + integerDigits + '.'
- final byte[] columnWidth = new byte [numCol]; // Total column width.
+ final String[] elements = new String [numCol * numRow]; // String representation of matrix values.
+ final boolean[] noFractionDigits = new boolean[numCol * numRow]; // Whether to remove the trailing ".0" for a given number.
+ final boolean[] hasDecimalSeparator = new boolean[numCol]; // Whether the column has at least one number where fraction digits are shown.
+ final byte[] maximumFractionDigits = new byte [numCol]; // The greatest amount of fraction digits found in a column.
+ final byte[] maximumPaddingZeros = new byte [numCol * numRow]; // Maximal amount of zeros that we can append before to exceed the IEEE 754 accuracy.
+ final byte[] widthBeforeFraction = new byte [numCol]; // Number of characters before the fraction digits: spacing + ('-') + integerDigits + '.'
+ final byte[] columnWidth = new byte [numCol]; // Total column width.
int totalWidth = 1;
/*
* Create now the string representation of all matrix elements and measure the width
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java?rev=1779702&r1=1779701&r2=1779702&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix1.java [UTF-8] Sat Jan 21 08:49:49 2017
@@ -38,6 +38,7 @@ import org.apache.sis.internal.util.Nume
* @see Matrix3
* @see Matrix4
*/
+@SuppressWarnings("CloneableClassWithoutClone") // No field in this class needs clone.
public final class Matrix1 extends MatrixSIS {
/**
* Serial number for inter-operability with different versions.
@@ -64,7 +65,7 @@ public final class Matrix1 extends Matri
/**
* Creates a new matrix filled with only zero values.
*
- * @param ignore Shall always be {@code false} in current version.
+ * @param ignore shall always be {@code false} in current version.
*/
Matrix1(final boolean ignore) {
}
@@ -82,8 +83,8 @@ public final class Matrix1 extends Matri
* Creates a new matrix initialized to the specified values.
* The length of the given array must be 1.
*
- * @param elements Elements of the matrix.
- * @throws IllegalArgumentException If the given array does not have the expected length.
+ * @param elements elements of the matrix.
+ * @throws IllegalArgumentException if the given array does not have the expected length.
*
* @see #setElements(double[])
* @see Matrices#create(int, int, double[])
@@ -97,7 +98,7 @@ public final class Matrix1 extends Matri
* The specified matrix size must be {@value #SIZE}×{@value #SIZE}.
* This is not verified by this constructor, since it shall be verified by {@link Matrices}.
*
- * @param matrix The matrix to copy.
+ * @param matrix the matrix to copy.
*/
Matrix1(final Matrix matrix) {
m00 = matrix.getElement(0,0);
@@ -108,10 +109,10 @@ public final class Matrix1 extends Matri
* is already an instance of {@code Matrix1}, then it is returned unchanged. Otherwise this method
* verifies the matrix size, then copies the element in a new {@code Matrix1} object.
*
- * @param matrix The matrix to cast or copy, or {@code null}.
- * @return The matrix argument if it can be safely casted (including {@code null} argument),
+ * @param matrix the matrix to cast or copy, or {@code null}.
+ * @return the matrix argument if it can be safely casted (including {@code null} argument),
* or a copy of the given matrix otherwise.
- * @throws MismatchedMatrixSizeException If the size of the given matrix is not {@value #SIZE}×{@value #SIZE}.
+ * @throws MismatchedMatrixSizeException if the size of the given matrix is not {@value #SIZE}×{@value #SIZE}.
*/
public static Matrix1 castOrCopy(final Matrix matrix) throws MismatchedMatrixSizeException {
if (matrix == null || matrix instanceof Matrix1) {
@@ -133,7 +134,7 @@ public final class Matrix1 extends Matri
/**
* Returns the number of rows in this matrix, which is always {@value #SIZE} in this implementation.
*
- * @return Always {@value #SIZE}.
+ * @return always {@value #SIZE}.
*/
@Override
public final int getNumRow() {
@@ -143,7 +144,7 @@ public final class Matrix1 extends Matri
/**
* Returns the number of columns in this matrix, which is always {@value #SIZE} in this implementation.
*
- * @return Always {@value #SIZE}.
+ * @return always {@value #SIZE}.
*/
@Override
public final int getNumCol() {
@@ -156,9 +157,9 @@ public final class Matrix1 extends Matri
* If the matrix is known to be an instance of {@code Matrix1},
* then the {@link #m00} field can be read directly for efficiency.
*
- * @param row The row index, which can only be 0.
- * @param column The column index, which can only be 0.
- * @return The current value.
+ * @param row the row index, which can only be 0.
+ * @param column the column index, which can only be 0.
+ * @return the current value.
*/
@Override
public final double getElement(final int row, final int column) {
@@ -175,9 +176,9 @@ public final class Matrix1 extends Matri
* If the matrix is known to be an instance of {@code Matrix1},
* then the {@link #m00} field can be set directly for efficiency.
*
- * @param row The row index, which can only be 0.
- * @param column The column index, which can only be 0.
- * @param value The new value to set.
+ * @param row the row index, which can only be 0.
+ * @param column the column index, which can only be 0.
+ * @param value the new value to set.
*/
@Override
public final void setElement(final int row, final int column, final double value) {
@@ -261,7 +262,7 @@ public final class Matrix1 extends Matri
* Returns {@code true} if the specified object is of type {@code Matrix1} and
* all of the data members are equal to the corresponding data members in this matrix.
*
- * @param object The object to compare with this matrix for equality.
+ * @param object the object to compare with this matrix for equality.
* @return {@code true} if the given object is equal to this matrix.
*/
@Override
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java?rev=1779702&r1=1779701&r2=1779702&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix2.java [UTF-8] Sat Jan 21 08:49:49 2017
@@ -39,6 +39,7 @@ import org.apache.sis.internal.util.Nume
* @see Matrix3
* @see Matrix4
*/
+@SuppressWarnings("CloneableClassWithoutClone") // No field in this class needs clone.
public final class Matrix2 extends MatrixSIS {
/**
* Serial number for inter-operability with different versions.
@@ -65,7 +66,7 @@ public final class Matrix2 extends Matri
/**
* Creates a new matrix filled with only zero values.
*
- * @param ignore Shall always be {@code false} in current version.
+ * @param ignore shall always be {@code false} in current version.
*/
Matrix2(final boolean ignore) {
}
@@ -73,10 +74,10 @@ public final class Matrix2 extends Matri
/**
* Creates a new matrix initialized to the specified values.
*
- * @param m00 The first matrix element in the first row.
- * @param m01 The second matrix element in the first row.
- * @param m10 The first matrix element in the second row.
- * @param m11 The second matrix element in the second row.
+ * @param m00 the first matrix element in the first row.
+ * @param m01 the second matrix element in the first row.
+ * @param m10 the first matrix element in the second row.
+ * @param m11 the second matrix element in the second row.
*/
public Matrix2(final double m00, final double m01,
final double m10, final double m11)
@@ -89,8 +90,8 @@ public final class Matrix2 extends Matri
* Creates a new matrix initialized to the specified values.
* The length of the given array must be 4 and the values in the same order than the above constructor.
*
- * @param elements Elements of the matrix. Column indices vary fastest.
- * @throws IllegalArgumentException If the given array does not have the expected length.
+ * @param elements elements of the matrix. Column indices vary fastest.
+ * @throws IllegalArgumentException if the given array does not have the expected length.
*
* @see #setElements(double[])
* @see Matrices#create(int, int, double[])
@@ -104,7 +105,7 @@ public final class Matrix2 extends Matri
* The specified matrix size must be {@value #SIZE}×{@value #SIZE}.
* This is not verified by this constructor, since it shall be verified by {@link Matrices}.
*
- * @param matrix The matrix to copy.
+ * @param matrix the matrix to copy.
*/
Matrix2(final Matrix matrix) {
m00 = matrix.getElement(0,0);
@@ -118,10 +119,10 @@ public final class Matrix2 extends Matri
* is already an instance of {@code Matrix2}, then it is returned unchanged. Otherwise this method
* verifies the matrix size, then copies all elements in a new {@code Matrix2} object.
*
- * @param matrix The matrix to cast or copy, or {@code null}.
- * @return The matrix argument if it can be safely casted (including {@code null} argument),
+ * @param matrix the matrix to cast or copy, or {@code null}.
+ * @return the matrix argument if it can be safely casted (including {@code null} argument),
* or a copy of the given matrix otherwise.
- * @throws MismatchedMatrixSizeException If the size of the given matrix is not {@value #SIZE}×{@value #SIZE}.
+ * @throws MismatchedMatrixSizeException if the size of the given matrix is not {@value #SIZE}×{@value #SIZE}.
*/
public static Matrix2 castOrCopy(final Matrix matrix) throws MismatchedMatrixSizeException {
if (matrix == null || matrix instanceof Matrix2) {
@@ -143,7 +144,7 @@ public final class Matrix2 extends Matri
/**
* Returns the number of rows in this matrix, which is always {@value #SIZE} in this implementation.
*
- * @return Always {@value #SIZE}.
+ * @return always {@value #SIZE}.
*/
@Override
public final int getNumRow() {
@@ -153,7 +154,7 @@ public final class Matrix2 extends Matri
/**
* Returns the number of columns in this matrix, which is always {@value #SIZE} in this implementation.
*
- * @return Always {@value #SIZE}.
+ * @return always {@value #SIZE}.
*/
@Override
public final int getNumCol() {
@@ -166,9 +167,9 @@ public final class Matrix2 extends Matri
* If the matrix is known to be an instance of {@code Matrix2},
* then the {@link #m00} … {@link #m11} fields can be read directly for efficiency.
*
- * @param row The row index, which can only be 0 or 1.
- * @param column The column index, which can only be 0 or 1.
- * @return The current value at the given row and column.
+ * @param row the row index, which can only be 0 or 1.
+ * @param column the column index, which can only be 0 or 1.
+ * @return the current value at the given row and column.
*/
@Override
public final double getElement(final int row, final int column) {
@@ -189,9 +190,9 @@ public final class Matrix2 extends Matri
* If the matrix is known to be an instance of {@code Matrix2},
* then the {@link #m00} … {@link #m11} fields can be set directly for efficiency.
*
- * @param row The row index, which can only be 0 or 1.
- * @param column The column index, which can only be 0 or 1.
- * @param value The new value to set at the given row and column.
+ * @param row the row index, which can only be 0 or 1.
+ * @param column the column index, which can only be 0 or 1.
+ * @param value the new value to set at the given row and column.
*/
@Override
public final void setElement(final int row, final int column, final double value) {
@@ -285,7 +286,7 @@ public final class Matrix2 extends Matri
* Returns {@code true} if the specified object is of type {@code Matrix2} and
* all of the data members are equal to the corresponding data members in this matrix.
*
- * @param object The object to compare with this matrix for equality.
+ * @param object the object to compare with this matrix for equality.
* @return {@code true} if the given object is equal to this matrix.
*/
@Override
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java?rev=1779702&r1=1779701&r2=1779702&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrix3.java [UTF-8] Sat Jan 21 08:49:49 2017
@@ -38,6 +38,7 @@ import org.opengis.referencing.operation
* @see Matrix2
* @see Matrix4
*/
+@SuppressWarnings("CloneableClassWithoutClone") // No field in this class needs clone.
public final class Matrix3 extends MatrixSIS {
/**
* Serial number for inter-operability with different versions.
@@ -69,7 +70,7 @@ public final class Matrix3 extends Matri
/**
* Creates a new matrix filled with only zero values.
*
- * @param ignore Shall always be {@code false} in current version.
+ * @param ignore shall always be {@code false} in current version.
*/
Matrix3(final boolean ignore) {
}
@@ -77,15 +78,15 @@ public final class Matrix3 extends Matri
/**
* Creates a new matrix initialized to the specified values.
*
- * @param m00 The first matrix element in the first row.
- * @param m01 The second matrix element in the first row.
- * @param m02 The third matrix element in the first row.
- * @param m10 The first matrix element in the second row.
- * @param m11 The second matrix element in the second row.
- * @param m12 The third matrix element in the second row.
- * @param m20 The first matrix element in the third row.
- * @param m21 The second matrix element in the third row.
- * @param m22 The third matrix element in the third row.
+ * @param m00 the first matrix element in the first row.
+ * @param m01 the second matrix element in the first row.
+ * @param m02 the third matrix element in the first row.
+ * @param m10 the first matrix element in the second row.
+ * @param m11 the second matrix element in the second row.
+ * @param m12 the third matrix element in the second row.
+ * @param m20 the first matrix element in the third row.
+ * @param m21 the second matrix element in the third row.
+ * @param m22 the third matrix element in the third row.
*/
public Matrix3(final double m00, final double m01, final double m02,
final double m10, final double m11, final double m12,
@@ -100,8 +101,8 @@ public final class Matrix3 extends Matri
* Creates a new matrix initialized to the specified values.
* The length of the given array must be 9 and the values in the same order than the above constructor.
*
- * @param elements Elements of the matrix. Column indices vary fastest.
- * @throws IllegalArgumentException If the given array does not have the expected length.
+ * @param elements elements of the matrix. Column indices vary fastest.
+ * @throws IllegalArgumentException if the given array does not have the expected length.
*
* @see #setElements(double[])
* @see Matrices#create(int, int, double[])
@@ -115,7 +116,7 @@ public final class Matrix3 extends Matri
* The specified matrix size must be {@value #SIZE}×{@value #SIZE}.
* This is not verified by this constructor, since it shall be verified by {@link Matrices}.
*
- * @param matrix The matrix to copy.
+ * @param matrix the matrix to copy.
*/
Matrix3(final Matrix matrix) {
for (int j=0; j
The non-linear part of the returned transform will be {@code this} transform, except if the ellipsoid * is spherical. In the later case, {@code this} transform will be replaced by a simplified implementation.
* - * @param factory The factory to use for creating the transform. - * @return The map projection from (λ,φ) to (x,y) coordinates. + * @param factory the factory to use for creating the transform. + * @return the map projection from (λ,φ) to (x,y) coordinates. * @throws FactoryException if an error occurred while creating a transform. */ @Override @@ -206,7 +206,7 @@ public class CylindricalEqualArea extend * (linear distance on a unit sphere). In addition, opportunistically computes the projection derivative * if {@code derivate} is {@code true}. * - * @return The matrix of the projection derivative at the given source position, + * @return the matrix of the projection derivative at the given source position, * or {@code null} if the {@code derivate} argument is {@code false}. * @throws ProjectionException if the coordinate can not be converted. */ @@ -295,7 +295,7 @@ public class CylindricalEqualArea extend /** * Constructs a new map projection from the parameters of the given projection. * - * @param other The other projection (usually ellipsoidal) from which to copy the parameters. + * @param other the other projection (usually ellipsoidal) from which to copy the parameters. */ Spherical(final CylindricalEqualArea other) { super(other); Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java?rev=1779702&r1=1779701&r2=1779702&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] Sat Jan 21 08:49:49 2017 @@ -185,7 +185,7 @@ final class Initializer { eccentricitySquared.subtract(f); } else { final DoubleDouble rs = new DoubleDouble(b); - rs.divide(k); // rs = b/a + rs.divide(k); // rs = b/a rs.square(); eccentricitySquared.value = 1; eccentricitySquared.subtract(rs); @@ -321,9 +321,10 @@ final class Initializer { final DoubleDouble t = verbatim(sinφ); t.square(); t.multiply(eccentricitySquared); - - // Compute 1 - ℯ²⋅sin²φ. Since ℯ²⋅sin²φ may be small, - // this is where double-double arithmetic has more value. + /* + * Compute 1 - ℯ²⋅sin²φ. Since ℯ²⋅sin²φ may be small, + * this is where double-double arithmetic has more value. + */ t.negate(); t.add(1,0); return t; Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java?rev=1779702&r1=1779701&r2=1779702&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] Sat Jan 21 08:49:49 2017 @@ -392,7 +392,7 @@ public class LambertConicConformal exten * Converts the specified (θ,φ) coordinate (units in radians) and stores the result in {@code dstPts}. * In addition, opportunistically computes the projection derivative if {@code derivate} is {@code true}. * - * @return The matrix of the projection derivative at the given source position, + * @return the matrix of the projection derivative at the given source position, * or {@code null} if the {@code derivate} argument is {@code false}. * @throws ProjectionException if the coordinate can not be converted. */ @@ -503,7 +503,7 @@ public class LambertConicConformal exten /** * Constructs a new map projection from the parameters of the given projection. * - * @param other The other projection (usually ellipsoidal) from which to copy the parameters. + * @param other the other projection (usually ellipsoidal) from which to copy the parameters. */ protected Spherical(final LambertConicConformal other) { super(other); Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1779702&r1=1779701&r2=1779702&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] Sat Jan 21 08:49:49 2017 @@ -138,8 +138,8 @@ public class Mercator extends ConformalP *The non-linear part of the returned transform will be {@code this} transform, except if the ellipsoid * is spherical. In the later case, {@code this} transform will be replaced by a simplified implementation.
* - * @param factory The factory to use for creating the transform. - * @return The map projection from (λ,φ) to (x,y) coordinates. + * @param factory the factory to use for creating the transform. + * @return the map projection from (λ,φ) to (x,y) coordinates. * @throws FactoryException if an error occurred while creating a transform. */ @Override @@ -328,7 +328,7 @@ public class Mercator extends ConformalP * (linear distance on a unit sphere). In addition, opportunistically computes the projection derivative * if {@code derivate} is {@code true}. * - * @return The matrix of the projection derivative at the given source position, + * @return the matrix of the projection derivative at the given source position, * or {@code null} if the {@code derivate} argument is {@code false}. * @throws ProjectionException if the coordinate can not be converted. */ @@ -349,8 +349,10 @@ public class Mercator extends ConformalP if (φ == 0) { y = φ; } else { - // See the javadoc of the Spherical inner class for a note - // about why we perform explicit checks for the pole cases. + /* + * See the javadoc of the Spherical inner class for a note + * about why we perform explicit checks for the pole cases. + */ final double a = abs(φ); if (a < PI/2) { y = log(expOfNorthing(φ, eccentricity * sinφ)); // Snyder (7-7) @@ -391,8 +393,10 @@ public class Mercator extends ConformalP while (--numPts >= 0) { final double φ = dstPts[dstOff += 2]; // Same as srcPts[srcOff + 1]. if (φ != 0) { - // See the javadoc of the Spherical inner class for a note - // about why we perform explicit checks for the pole cases. + /* + * See the javadoc of the Spherical inner class for a note + * about why we perform explicit checks for the pole cases. + */ final double a = abs(φ); final double y; if (a < PI/2) { @@ -459,7 +463,7 @@ public class Mercator extends ConformalP /** * Constructs a new map projection from the parameters of the given projection. * - * @param other The other projection (usually ellipsoidal) from which to copy the parameters. + * @param other the other projection (usually ellipsoidal) from which to copy the parameters. */ Spherical(final Mercator other) { super(other); Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java?rev=1779702&r1=1779701&r2=1779702&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java [UTF-8] Sat Jan 21 08:49:49 2017 @@ -18,6 +18,7 @@ package org.apache.sis.referencing.opera import java.util.Map; import java.util.HashMap; +import java.util.Objects; import java.io.Serializable; import java.lang.reflect.Modifier; import org.opengis.metadata.Identifier; @@ -54,9 +55,6 @@ import org.apache.sis.util.resources.Err import static java.lang.Math.*; -// Branch-dependent imports -import java.util.Objects; - /** * Base class for conversion services between ellipsoidal and cartographic projections. @@ -401,10 +399,10 @@ public abstract class NormalizedProjecti * this constructor. But those values will be converted to the units of measurement specified by the parameter * descriptors in the {@code roles} map, which must be the above-cited units. * - * @param method Description of the map projection parameters. - * @param parameters The parameters of the projection to be created. - * @param roles Parameters to look for central meridian, scale factor, - * false easting, false northing and other values. + * @param method description of the map projection parameters. + * @param parameters the parameters of the projection to be created. + * @param roles parameters to look for central meridian, scale factor, + * false easting, false northing and other values. */ protected NormalizedProjection(final OperationMethod method, final Parameters parameters, final MapThe non-linear part of the returned transform will be {@code this} transform, except if the ellipsoid * is spherical. In the later case, {@code this} transform will be replaced by a simplified implementation.
* - * @param factory The factory to use for creating the transform. - * @return The map projection from (λ,φ) to (x,y) coordinates. + * @param factory the factory to use for creating the transform. + * @return the map projection from (λ,φ) to (x,y) coordinates. * @throws FactoryException if an error occurred while creating a transform. */ @Override @@ -278,7 +278,7 @@ public class PolarStereographic extends * Converts the specified (θ,φ) coordinate (units in radians) and stores the result in {@code dstPts}. * In addition, opportunistically computes the projection derivative if {@code derivate} is {@code true}. * - * @return The matrix of the projection derivative at the given source position, + * @return the matrix of the projection derivative at the given source position, * or {@code null} if the {@code derivate} argument is {@code false}. * @throws ProjectionException if the coordinate can not be converted. */ @@ -333,7 +333,7 @@ public class PolarStereographic extends { final double x = srcPts[srcOff ]; final double y = srcPts[srcOff+1]; - dstPts[dstOff ] = atan2(x, y); // Really (x,y), not (y,x) + dstPts[dstOff ] = atan2(x, y); // Really (x,y), not (y,x) dstPts[dstOff+1] = -φ(hypot(x, y)); } @@ -358,7 +358,7 @@ public class PolarStereographic extends /** * Constructs a new map projection from the parameters of the given projection. * - * @param other The other projection (usually ellipsoidal) from which to copy the parameters. + * @param other the other projection (usually ellipsoidal) from which to copy the parameters. */ protected Spherical(final PolarStereographic other) { super(other); @@ -372,13 +372,13 @@ public class PolarStereographic extends final double[] dstPts, final int dstOff, final boolean derivate) throws ProjectionException { - final double θ = srcPts[srcOff ]; // θ = λ - λ₀ + final double θ = srcPts[srcOff ]; // θ = λ - λ₀ final double φ = srcPts[srcOff+1]; final double sinθ = sin(θ); final double cosθ = cos(θ); final double t = tan(PI/4 + 0.5*φ); - final double x = t * sinθ; // Synder 21-5 - final double y = t * cosθ; // Synder 21-6 + final double x = t * sinθ; // Synder 21-5 + final double y = t * cosθ; // Synder 21-6 if (dstPts != null) { dstPts[dstOff ] = x; dstPts[dstOff+1] = y; @@ -387,8 +387,8 @@ public class PolarStereographic extends return null; } final double dt = t / cos(φ); - return new Matrix2(y, dt*sinθ, // ∂x/∂λ , ∂x/∂φ - -x, dt*cosθ); // ∂y/∂λ , ∂y/∂φ + return new Matrix2(y, dt*sinθ, // ∂x/∂λ , ∂x/∂φ + -x, dt*cosθ); // ∂y/∂λ , ∂y/∂φ } /**