org.geotoolkit.image.io.plugin
Class AsciiGridReader.Spi
Object
IIOServiceProvider
ImageReaderWriterSpi
ImageReaderSpi
SpatialImageReader.Spi
StreamImageReader.Spi
TextImageReader.Spi
AsciiGridReader.Spi
- All Implemented Interfaces:
- RegisterableService
- Enclosing class:
- AsciiGridReader
public static class AsciiGridReader.Spi
- extends TextImageReader.Spi
Service provider interface (SPI) for AsciiGridReaders. This SPI provides
the necessary implementation for creating default AsciiGridReaders using
US locale and ASCII character set. The locale and
charset fields are ignored by the default implementation.
The default constructor initializes the fields to the values listed below.
Users wanting different values should create a subclass of Spi and
set the desired values in their constructor.
- Since:
- 3.08 (derived from 3.07)
- Version:
- 3.08
- Author:
- Martin Desruisseaux (Geomatys)
- See Also:
AsciiGridWriter.Spi
- Module:
| Fields inherited from class ImageReaderWriterSpi |
extraImageMetadataFormatClassNames, extraImageMetadataFormatNames, extraStreamMetadataFormatClassNames, extraStreamMetadataFormatNames, MIMETypes, names, nativeImageMetadataFormatClassName, nativeImageMetadataFormatName, nativeStreamMetadataFormatClassName, nativeStreamMetadataFormatName, pluginClassName, suffixes, supportsStandardImageMetadataFormat, supportsStandardStreamMetadataFormat |
|
Method Summary |
ImageReader |
createReaderInstance(Object extension)
Returns an instance of the ImageReader implementation associated
with this service provider. |
String |
getDescription(Locale locale)
Returns a brief, human-readable description of this service provider
and its associated implementation. |
protected boolean |
isValidContent(double[][] rows)
Returns true unconditionally, because ASCII grid files don't require lines
of same length. |
protected boolean |
isValidHeader(Set<String> keywords)
Returns true if the given set of keywords contains at least the
"NCOLS" and "NROWS" elements. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsciiGridReader.Spi
public AsciiGridReader.Spi()
- Constructs a default
AsciiGridReader.Spi. The fields are initialized as
documented in the class javadoc. Subclasses can
modify those values if desired.
For efficiency reasons, the fields are initialized to shared arrays.
Subclasses can assign new arrays, but should not modify the default array content.
getDescription
public String getDescription(Locale locale)
- Returns a brief, human-readable description of this service provider
and its associated implementation. The resulting string should be
localized for the supplied locale, if possible.
- Specified by:
getDescription in class IIOServiceProvider
- Parameters:
locale - A Locale for which the return value should be localized.
- Returns:
- A String containing a description of this service provider.
createReaderInstance
public ImageReader createReaderInstance(Object extension)
throws IOException
- Returns an instance of the
ImageReader implementation associated
with this service provider.
- Specified by:
createReaderInstance in class ImageReaderSpi
- Parameters:
extension - An optional extension object, which may be null.
- Returns:
- An image reader instance.
- Throws:
IOException - if the attempt to instantiate the reader fails.
isValidHeader
protected boolean isValidHeader(Set<String> keywords)
- Returns
true if the given set of keywords contains at least the
"NCOLS" and "NROWS" elements.
- Overrides:
isValidHeader in class TextImageReader.Spi
- Parameters:
keywords - The first word found in every header lines,
converted to upper-case.
- Returns:
true if the set of keywords is known to this format.
isValidContent
protected boolean isValidContent(double[][] rows)
- Returns
true unconditionally, because ASCII grid files don't require lines
of same length. This method returns true even if there is no data at all,
because those data can be stored in a separated RAW file (this behavior is a Geotk
extension)
- Overrides:
isValidContent in class TextImageReader.Spi
- Parameters:
rows - The first few rows.
- Returns:
true if the given rows seem to have a valid content.
Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.