Package gov.nasa.worldwind.data
Class AbstractDataRasterReader
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.data.AbstractDataRasterReader
-
- All Implemented Interfaces:
AVList,DataRasterReader
- Direct Known Subclasses:
BILRasterReader,DDSRasterReader,DTEDRasterReader,GDALDataRasterReader,GeotiffRasterReader,ImageIORasterReader,RPFRasterReader
public abstract class AbstractDataRasterReader extends AVListImpl implements DataRasterReader
Abstract base class for mostDataRasterReaderimplementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringdescriptionprotected java.lang.String[]mimeTypesprotected java.lang.String[]suffixes
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDataRasterReader(java.lang.String description)AbstractDataRasterReader(java.lang.String[] mimeTypes, java.lang.String[] suffixes)AbstractDataRasterReader(java.lang.String description, java.lang.String[] mimeTypes, java.lang.String[] suffixes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanRead(java.lang.Object source, AVList params)Indicates whether this reader can read a specified data source.protected booleancanReadSuffix(java.lang.Object source)protected abstract booleandoCanRead(java.lang.Object source, AVList params)protected abstract DataRaster[]doRead(java.lang.Object source, AVList params)protected abstract voiddoReadMetadata(java.lang.Object source, AVList params)java.lang.StringgetDescription()java.lang.String[]getMimeTypes()java.lang.String[]getSuffixes()booleanisElevationsRaster(java.lang.Object source, AVList params)Indicates whether a data source is elevation data.booleanisImageryRaster(java.lang.Object source, AVList params)Indicates whether a data source is imagery.DataRaster[]read(java.lang.Object source, AVList params)Reads and returns the DataRaster instances from a data source.AVListreadMetadata(java.lang.Object source, AVList params)Reads and returns the metadata from a data source.protected java.lang.StringvalidateMetadata(java.lang.Object source, AVList params)-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
Constructor Detail
-
AbstractDataRasterReader
public AbstractDataRasterReader(java.lang.String description, java.lang.String[] mimeTypes, java.lang.String[] suffixes)
-
AbstractDataRasterReader
public AbstractDataRasterReader(java.lang.String[] mimeTypes, java.lang.String[] suffixes)
-
AbstractDataRasterReader
protected AbstractDataRasterReader(java.lang.String description)
-
-
Method Detail
-
doCanRead
protected abstract boolean doCanRead(java.lang.Object source, AVList params)
-
doRead
protected abstract DataRaster[] doRead(java.lang.Object source, AVList params) throws java.io.IOException
- Throws:
java.io.IOException
-
doReadMetadata
protected abstract void doReadMetadata(java.lang.Object source, AVList params) throws java.io.IOException- Throws:
java.io.IOException
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceDataRasterReader
-
getMimeTypes
public java.lang.String[] getMimeTypes()
-
getSuffixes
public java.lang.String[] getSuffixes()
- Specified by:
getSuffixesin interfaceDataRasterReader
-
canRead
public boolean canRead(java.lang.Object source, AVList params)Indicates whether this reader can read a specified data source. The source may be one of the following:FileStringInputStreamURL
- Specified by:
canReadin interfaceDataRasterReader- Parameters:
source- the source to examine.params- parameters required by certain reader implementations. May be null for most readers.- Returns:
- true if this reader can read the data source, otherwise false.
-
canReadSuffix
protected boolean canReadSuffix(java.lang.Object source)
-
read
public DataRaster[] read(java.lang.Object source, AVList params) throws java.io.IOException
Reads and returns the DataRaster instances from a data source. The source may be one of the following: The source may be one of the following:FileStringInputStreamURL
- Specified by:
readin interfaceDataRasterReader- Parameters:
source- the source to read.params- parameters required by certain reader implementations. May be null for most readers. If non-null, the metadata is added to this list, and the list reference is the return value of this method.- Returns:
- the list of metadata read from the data source. The list is empty if the data source has no metadata.
- Throws:
java.io.IOException- if an IO error occurs.
-
readMetadata
public AVList readMetadata(java.lang.Object source, AVList params) throws java.io.IOException
Reads and returns the metadata from a data source. The source may be one of the following:FileStringInputStreamURL
- Specified by:
readMetadatain interfaceDataRasterReader- Parameters:
source- the source to examine.params- parameters required by certain reader implementations. May be null for most readers. If non-null, the metadata is added to this list, and the list reference is the return value of this method.- Returns:
- the list of metadata read from the data source. The list is empty if the data source has no metadata.
- Throws:
java.io.IOException- if an IO error occurs.
-
validateMetadata
protected java.lang.String validateMetadata(java.lang.Object source, AVList params)
-
isImageryRaster
public boolean isImageryRaster(java.lang.Object source, AVList params)Indicates whether a data source is imagery. TODO: Identify when parameters must be passed. The source may be one of the following:FileStringInputStreamURL
- Specified by:
isImageryRasterin interfaceDataRasterReader- Parameters:
source- the source to examine.params- parameters required by certain reader implementations. May be null for most readers.- Returns:
- true if the source is imagery, otherwise false.
-
isElevationsRaster
public boolean isElevationsRaster(java.lang.Object source, AVList params)Indicates whether a data source is elevation data. TODO: Identify when parameters must be passed. The source may be one of the following:FileStringInputStreamURL
- Specified by:
isElevationsRasterin interfaceDataRasterReader- Parameters:
source- the source to examine.params- parameters required by certain reader implementations. May be null for most readers. TODO: Identify when parameters must be passed.- Returns:
- true if the source is elevation data, otherwise false.
-
-