org.geotools.image.io.mosaic
Class TileManagerFactory

java.lang.Object
  extended by org.geotools.factory.AbstractFactory
      extended by org.geotools.image.io.mosaic.TileManagerFactory
All Implemented Interfaces:
javax.imageio.spi.RegisterableService, Factory

public class TileManagerFactory
extends AbstractFactory

Creates TileManager instances from a collection of tiles.

Since:
2.5
Version:
$Id: TileManagerFactory.java 30729 2008-06-16 09:26:48Z desruisseaux $
Author:
Martin Desruisseaux

Field Summary
static TileManagerFactory DEFAULT
          The default instance.
 
Fields inherited from class org.geotools.factory.AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
 
Constructor Summary
protected TileManagerFactory(Hints hints)
          Creates a new factory from the specified hints.
 
Method Summary
 TileManager[] create(java.util.Collection<Tile> tiles)
          Creates tile managers from the specified collection of tiles.
 TileManager[] create(Tile[] tiles)
          Creates tile managers from the specified array of tiles.
 TileManager[] createFromObject(java.lang.Object tiles)
          Creates tile managers from the specified object, which may be null.
protected  TileManager createGeneric(Tile[] tiles)
          Creates a single tile manager from the given array of tiles.
 
Methods inherited from class org.geotools.factory.AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final TileManagerFactory DEFAULT
The default instance.

Constructor Detail

TileManagerFactory

protected TileManagerFactory(Hints hints)
Creates a new factory from the specified hints.

Parameters:
hints - Optional hints, or null if none.
Method Detail

createFromObject

public TileManager[] createFromObject(java.lang.Object tiles)
                               throws java.io.IOException,
                                      java.lang.IllegalArgumentException
Creates tile managers from the specified object, which may be null. If non-null, the object shall be an instance of TileManager[], TileManager, Tile[] or Collection<Tile>.

Parameters:
tiles - The tiles, or null.
Returns:
The tile managers, or null if tiles was null.
Throws:
java.lang.IllegalArgumentException - if tiles is not an instance of a valid class, or if it is an array or a collection containing null elements.
java.io.IOException - If an I/O operation was required and failed.

create

public TileManager[] create(Tile[] tiles)
                     throws java.io.IOException
Creates tile managers from the specified array of tiles. This method usually returns a single tile manager, but more could be returned if this factory has been unable to put every tiles in a single mosaic (for example if the ratio between affine transform given to tile constructor would lead to fractional subsampling).

Parameters:
tiles - The tiles to give to a tile manager.
Returns:
A tile manager created from the given tiles.
Throws:
java.io.IOException - If an I/O operation was required and failed.

create

public TileManager[] create(java.util.Collection<Tile> tiles)
                     throws java.io.IOException
Creates tile managers from the specified collection of tiles. This method usually returns a single tile manager, but more could be returned if this factory has been unable to put every tiles in a single mosaic (for example if the ratio between affine transform given to tile constructor would lead to fractional subsampling).

Parameters:
tiles - The tiles to give to a tile manager.
Returns:
A tile manager created from the given tiles.
Throws:
java.io.IOException - If an I/O operation was required and failed.

createGeneric

protected TileManager createGeneric(Tile[] tiles)
                             throws java.io.IOException
Creates a single tile manager from the given array of tiles. This method is automatically invoked by create methods. The tile array has already been cloned and can be stored directly by the tile manager constructors.

Subclasses can override this method if they want to create other kinds of tile managers.

Parameters:
tiles - A copy of user-supplied tiles.
Returns:
The tile manager for the given tiles.
Throws:
java.io.IOException - If an I/O operation was required and failed.


Copyright © 1996-2010 Geotools. All Rights Reserved.