This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit e900738bdd7e816b198f8ef56f20e730b1c36596
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Sat Feb 15 00:49:05 2020 +0100

    Renamed MosaicCalculator as TileOrganizer.
---
 .../apache/sis/internal/referencing/j2d/Tile.java  | 54 +++++++++++-----------
 .../{MosaicCalculator.java => TileOrganizer.java}  | 11 ++---
 .../referencing/j2d/TranslatedTransform.java       |  2 +-
 .../referencing/provider/DatumShiftGridGroup.java  | 10 ++--
 4 files changed, 38 insertions(+), 39 deletions(-)

diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/Tile.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/Tile.java
index 847fb42..b2ec2ae 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/Tile.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/Tile.java
@@ -92,11 +92,11 @@ import org.apache.sis.io.TableAppender;
  * </ul>
  *
  * The tiles are not required to be arranged on a regular grid, but 
performances may be better if they are.
- * {@link MosaicCalculator} is responsible for analyzing the layout of a 
collection of tiles.
+ * {@link TileOrganizer} is responsible for analyzing the layout of a 
collection of tiles.
  *
  * <h2>Multi-threading</h2>
  * This class is thread-safe. In addition {@code Tile} instances can be 
considered as immutable after construction.
- * However some properties may be available only after the tiles have been 
processed by a {@link MosaicCalculator},
+ * However some properties may be available only after the tiles have been 
processed by a {@link TileOrganizer},
  * or only after {@link #fetchSize()} has been invoked.
  *
  * @author  Martin Desruisseaux (Geomatys)
@@ -134,20 +134,20 @@ public class Tile implements Serializable {
      * has not yet been computed.
      *
      * <p>This field should be considered as final. It is not final only 
because
-     * {@link MosaicCalculator} may compute this value automatically.</p>
+     * {@link TileOrganizer} may compute this value automatically.</p>
      *
      * @see #getSubsampling()
      */
     private int xSubsampling, ySubsampling;
 
     /**
-     * The "grid to real world" transform, used by {@link MosaicCalculator} in 
order to compute
+     * The "grid to real world" transform, used by {@link TileOrganizer} in 
order to compute
      * the {@linkplain #getRegion() region} for this tile. This field is set 
to {@code null} when
-     * {@link MosaicCalculator}'s work is in progress, and set to a new value 
on completion.
+     * {@link TileOrganizer}'s work is in progress, and set to a new value on 
completion.
      *
-     * <p><b>Note:</b> {@link MosaicCalculator} really needs a new instance 
for each tile.
-     * No caching allowed before {@link MosaicCalculator} processing.
-     * Caching is allowed <em>after</em> {@link MosaicCalculator} processing 
is completed.</p>
+     * <p><b>Note:</b> {@link TileOrganizer} really needs a new instance for 
each tile.
+     * No caching allowed before {@link TileOrganizer} processing.
+     * Caching is allowed <em>after</em> {@link TileOrganizer} processing is 
completed.</p>
      */
     private AffineTransform gridToCRS;
 
@@ -195,16 +195,16 @@ public class Tile implements Serializable {
      * Creates a tile for the given region and <cite>"grid to real 
world"</cite> transform.
      * This constructor can be used when the {@linkplain #getLocation() 
location} of the tile is unknown.
      * The location and subsampling will be computed automatically when this 
tile will be processed by a
-     * {@link MosaicCalculator}.
+     * {@link TileOrganizer}.
      *
      * <p>When using this constructor, the {@link #getLocation()}, {@link 
#getRegion()} and
      * {@link #getSubsampling()} methods will throw an {@link 
IllegalStateException} until
-     * this tile has been processed by a {@link MosaicCalculator}, which will 
compute those
+     * this tile has been processed by a {@link TileOrganizer}, which will 
compute those
      * values automatically.</p>
      *
      * @param region     the tile region, or {@code null} if unknown.
      *                   The (<var>x</var>,<var>y</var> location of this 
region is typically (0,0).
-     *                   The final location will be computed when this tile 
will be given to a {@link MosaicCalculator}.
+     *                   The final location will be computed when this tile 
will be given to a {@link TileOrganizer}.
      * @param gridToCRS  the <cite>"grid to real world"</cite> transform 
mapping pixel
      *                   {@linkplain PixelOrientation#UPPER_LEFT upper left} 
corner.
      */
@@ -221,7 +221,7 @@ public class Tile implements Serializable {
 
     /**
      * Creates a new tile for the given final transform.
-     * This is used for storing {@link MosaicCalculator} results.
+     * This is used for storing {@link TileOrganizer} results.
      */
     Tile(final AffineTransform gridToCRS, final Rectangle region) {
         this.x         = region.x;
@@ -234,7 +234,7 @@ public class Tile implements Serializable {
 
     /**
      * Checks if the location, region, and subsampling can be returned. Throws 
an exception if this
-     * tile has been created without location and not yet processed by {@link 
MosaicCalculator}.
+     * tile has been created without location and not yet processed by {@link 
TileOrganizer}.
      */
     private void ensureDefined() throws IllegalStateException {
         if (xSubsampling == 0 || ySubsampling == 0) {
@@ -247,7 +247,7 @@ public class Tile implements Serializable {
      *
      * @return the tile upper-left corner.
      * @throws IllegalStateException if this tile has been {@linkplain 
#Tile(Rectangle, AffineTransform)
-     *         created without location} and has not yet been processed by 
{@link MosaicCalculator}.
+     *         created without location} and has not yet been processed by 
{@link TileOrganizer}.
      *
      * @see javax.imageio.ImageReadParam#setDestinationOffset(Point)
      */
@@ -263,7 +263,7 @@ public class Tile implements Serializable {
      *
      * <p>At the difference of {@link #getLocation()} and {@link 
#getRegion()}, this method never
      * throw {@link IllegalStateException} because the tile size does not 
depend on the processing
-     * performed by {@link MosaicCalculator}.</p>
+     * performed by {@link TileOrganizer}.</p>
      *
      * @return the tile size.
      * @throws IOException if an I/O operation was required for fetching the 
tile size and that operation failed.
@@ -302,7 +302,7 @@ public class Tile implements Serializable {
      * @return the region in the mosaic (destination image).
      * @throws IOException if an I/O operation was required for fetching the 
tile size and that operation failed.
      * @throws IllegalStateException if this tile has been {@linkplain 
#Tile(Rectangle, AffineTransform) created
-     *         without location} and has not yet been processed by {@link 
MosaicCalculator}, of if this tile does
+     *         without location} and has not yet been processed by {@link 
TileOrganizer}, of if this tile does
      *         not have enough information for providing a tile size.
      *
      * @see javax.imageio.ImageReadParam#setSourceRegion(Rectangle)
@@ -325,7 +325,7 @@ public class Tile implements Serializable {
      * @return the region in units relative to the tile having the finest 
resolution.
      * @throws IOException if an I/O operation was required for fetching the 
tile size and that operation failed.
      * @throws IllegalStateException if this tile has been {@linkplain 
#Tile(Rectangle, AffineTransform) created
-     *         without location} and has not yet been processed by {@link 
MosaicCalculator}, of if this tile does
+     *         without location} and has not yet been processed by {@link 
TileOrganizer}, of if this tile does
      *         not have enough information for providing a tile size.
      */
     public synchronized Rectangle getAbsoluteRegion() throws IOException {
@@ -340,7 +340,7 @@ public class Tile implements Serializable {
     }
 
     /**
-     * Invoked by {@link MosaicCalculator} only. No other caller allowed.
+     * Invoked by {@link TileOrganizer} only. No other caller allowed.
      * {@link #setSubsampling(Dimension)} must be invoked prior this method.
      *
      * <p>Note that invoking this method usually invalidate {@link #gridToCRS}.
@@ -368,7 +368,7 @@ public class Tile implements Serializable {
      *
      * @return the subsampling along <var>x</var> and <var>y</var> axes.
      * @throws IllegalStateException if this tile has been {@linkplain 
#Tile(Rectangle, AffineTransform)
-     *         created without location} and has not yet been processed by 
{@link MosaicCalculator}.
+     *         created without location} and has not yet been processed by 
{@link TileOrganizer}.
      *
      * @see javax.imageio.ImageReadParam#setSourceSubsampling(int, int, int, 
int)
      */
@@ -379,7 +379,7 @@ public class Tile implements Serializable {
 
     /**
      * Sets the subsampling to the given dimension.
-     * Invoked by constructors and {@link MosaicCalculator} only.
+     * Invoked by constructors and {@link TileOrganizer} only.
      */
     final void setSubsampling(final Dimension subsampling) throws 
IllegalStateException {
         // No assert Thread.holdsLock(this) because invoked from constructors.
@@ -397,14 +397,14 @@ public class Tile implements Serializable {
     }
 
     /**
-     * If the user-supplied transform is waiting for processing by {@link 
MosaicCalculator}, returns it.
-     * Otherwise returns {@code null}. This method is for internal usage by 
{@link MosaicCalculator} only.
+     * If the user-supplied transform is waiting for processing by {@link 
TileOrganizer}, returns it.
+     * Otherwise returns {@code null}. This method is for internal usage by 
{@link TileOrganizer} only.
      *
      * <p>This method clears the {@link #gridToCRS} field before to return. 
This is a way to tell that
      * processing is in progress, and also a safety against transform usage 
while it may become invalid.</p>
      *
      * @return the transform, or {@code null} if none. This method does not 
clone the returned value -
-     *         {@link MosaicCalculator} will reference and modify directly 
that transform.
+     *         {@link TileOrganizer} will reference and modify directly that 
transform.
      */
     final synchronized AffineTransform getPendingGridToCRS() {
         if ((xSubsampling | ySubsampling) != 0) {
@@ -437,14 +437,14 @@ public class Tile implements Serializable {
      * @return the <cite>"grid to real world"</cite> transform mapping pixel
      *         {@linkplain PixelOrientation#UPPER_LEFT upper left} corner, or 
{@code null} if undefined.
      * @throws IllegalStateException if this tile has been {@linkplain 
#Tile(Rectangle, AffineTransform)
-     *         created without location} and has not yet been processed by 
{@link MosaicCalculator}.
+     *         created without location} and has not yet been processed by 
{@link TileOrganizer}.
      */
     public synchronized AffineTransform2D getGridToCRS() throws 
IllegalStateException {
         ensureDefined();
         /*
          * The cast should not fail: if the `gridToCRS` is the one specified 
at construction time,
          * then `ensureDefined()` should have thrown an IllegalStateException. 
Otherwise this tile
-         * have been processed by `MosaicCalculator`, which has set an 
`AffineTransform2D` instance.
+         * have been processed by `TileOrganizer`, which has set an 
`AffineTransform2D` instance.
          * If we get a ClassCastException below, then there is a bug in our 
pre/post conditions.
          */
         return (AffineTransform2D) gridToCRS;
@@ -468,7 +468,7 @@ public class Tile implements Serializable {
     }
 
     /**
-     * Translates this tile. For internal usage by {@link MosaicCalculator} 
only.
+     * Translates this tile. For internal usage by {@link TileOrganizer} only.
      *
      * <p>Reminder: {@link #setGridToCRS(AffineTransform)} should be invoked 
after this method.</p>
      *
@@ -511,7 +511,7 @@ public class Tile implements Serializable {
      * which can still be modified (only once) by MocaicCalculator, or by read 
operations during `getSize()`
      * or `getRegion()` execution. This causes confusing behavior when used in 
an HashMap. We are better to
      * rely on system identity. For example `DatumShiftGridGroup` rely on the 
capability to locate Tiles in
-     * HashMap before and after they have been processed by `MosaicCalculator`.
+     * HashMap before and after they have been processed by `TileOrganizer`.
      */
 
     /**
diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/MosaicCalculator.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TileOrganizer.java
similarity index 98%
rename from 
core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/MosaicCalculator.java
rename to 
core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TileOrganizer.java
index e1f4445..fb4f0a4 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/MosaicCalculator.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TileOrganizer.java
@@ -23,7 +23,6 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.IdentityHashMap;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.io.IOException;
@@ -43,7 +42,7 @@ import 
org.apache.sis.referencing.operation.matrix.AffineTransforms2D;
  * But in some cases the destination rectangle is not known directly. Instead 
we have a set of tiles,
  * all of them with an upper-left corner located at (0,0), but different 
<cite>grid to CRS</cite>
  * affine transforms read from <a 
href="https://en.wikipedia.org/wiki/World_file";>World Files</a>.
- * This {@code MosaicCalculator} class infers the destination regions 
automatically
+ * This {@code TileOrganizer} class infers the destination regions 
automatically
  * from the set of affine transforms.
  *
  * @author  Martin Desruisseaux (Geomatys)
@@ -51,7 +50,7 @@ import 
org.apache.sis.referencing.operation.matrix.AffineTransforms2D;
  * @since   1.1
  * @module
  */
-public class MosaicCalculator {
+public class TileOrganizer {
     /**
      * Small number for floating point comparisons.
      */
@@ -75,7 +74,7 @@ public class MosaicCalculator {
      *
      * @param  location  the location, or {@code null} for (0,0).
      */
-    public MosaicCalculator(final Point location) {
+    public TileOrganizer(final Point location) {
         if (location != null) {
             xLocation = location.x;
             yLocation = location.y;
@@ -128,7 +127,7 @@ public class MosaicCalculator {
      * <p><strong>Invoking this method clear the collection</strong>. On 
return, this instance is empty.
      * This is because current implementation modify its workspace directly 
for efficiency.</p>
      *
-     * @return all tiles added to this {@code MosaicCalculator}, grouped by 
pyramids.
+     * @return all tiles added to this {@code TileOrganizer}, grouped by 
pyramids.
      * @throws IOException if a call to {@link Tile#getSize()} or {@link 
Tile#getRegion()} failed,
      *         and {@link #unavailableSize(Tile, IOException)} did not 
consumed the exception.
      */
@@ -490,7 +489,7 @@ public class MosaicCalculator {
 
     /**
      * Invoked when an I/O error occurred in {@link Tile#getSize()} or {@link 
Tile#getRegion()}.
-     * This error is non-fatal since {@code MosaicCalculator} can fallback on 
calculation based
+     * This error is non-fatal since {@code TileOrganizer} can fallback on 
calculation based
      * on tile location only (without size).
      *
      * <p>The default implementation returns {@code false}, which instructs 
the caller to let
diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TranslatedTransform.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TranslatedTransform.java
index c755db7..59b2b30 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TranslatedTransform.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/TranslatedTransform.java
@@ -23,7 +23,7 @@ import java.awt.geom.AffineTransform;
 /**
  * An affine transform which is translated relative to an original transform.
  * The translation terms are stored separately without modifying the transform.
- * This class if for internal use by {@link MosaicCalculator} only.
+ * This class if for internal use by {@link TileOrganizer} only.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.1
diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridGroup.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridGroup.java
index e634375..883f45b 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridGroup.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/DatumShiftGridGroup.java
@@ -29,7 +29,7 @@ import org.opengis.util.FactoryException;
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.apache.sis.referencing.operation.transform.InterpolatedTransform;
 import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
-import org.apache.sis.internal.referencing.j2d.MosaicCalculator;
+import org.apache.sis.internal.referencing.j2d.TileOrganizer;
 import org.apache.sis.internal.referencing.j2d.Tile;
 import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.internal.util.CollectionsExt;
@@ -58,7 +58,7 @@ final class DatumShiftGridGroup<C extends Quantity<C>, T 
extends Quantity<T>> ex
         /** Subsampling compared to the grid having finest resolution. */
         private final double sx, sy;
 
-        /** Creates a new instance from the given {@link MosaicCalculator} 
result. */
+        /** Creates a new instance from the given {@link TileOrganizer} 
result. */
         Region(final Tile tile) throws IOException {
             final Rectangle r = tile.getAbsoluteRegion();
             final Dimension s = tile.getSubsampling();
@@ -101,8 +101,8 @@ final class DatumShiftGridGroup<C extends Quantity<C>, T 
extends Quantity<T>> ex
      * The first sub-grid is taken as a template for setting parameter values 
such as filename (all list
      * elements should declare the same filename parameters, so the selected 
element should not matter).
      *
-     * @param  tiles      the tiles computed by {@link MosaicCalculator}.
-     * @param  grids      sub-grids associated to tiles computed by {@link 
MosaicCalculator}.
+     * @param  tiles      the tiles computed by {@link TileOrganizer}.
+     * @param  grids      sub-grids associated to tiles computed by {@link 
TileOrganizer}.
      * @param  gridToCRS  conversion from grid indices to "real world" 
coordinates.
      * @param  nx         number of cells along the <var>x</var> axis in the 
grid.
      * @param  ny         number of cells along the <var>y</var> axis in the 
grid.
@@ -136,7 +136,7 @@ final class DatumShiftGridGroup<C extends Quantity<C>, T 
extends Quantity<T>> ex
             final Path file, final List<DatumShiftGridFile<C,T>> subgrids)
             throws IOException, FactoryException, 
NoninvertibleTransformException
     {
-        final MosaicCalculator mosaic = new MosaicCalculator(null);
+        final TileOrganizer mosaic = new TileOrganizer(null);
         final Map<Tile,DatumShiftGridFile<C,T>> grids = new LinkedHashMap<>();
         for (final DatumShiftGridFile<C,T> grid : subgrids) {
             final int[] size = grid.getGridSize();

Reply via email to