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 mostDataRasterReader
implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
description
protected java.lang.String[]
mimeTypes
protected java.lang.String[]
suffixes
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDataRasterReader(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 boolean
canRead(java.lang.Object source, AVList params)
Indicates whether this reader can read a specified data source.protected boolean
canReadSuffix(java.lang.Object source)
protected abstract boolean
doCanRead(java.lang.Object source, AVList params)
protected abstract DataRaster[]
doRead(java.lang.Object source, AVList params)
protected abstract void
doReadMetadata(java.lang.Object source, AVList params)
java.lang.String
getDescription()
java.lang.String[]
getMimeTypes()
java.lang.String[]
getSuffixes()
boolean
isElevationsRaster(java.lang.Object source, AVList params)
Indicates whether a data source is elevation data.boolean
isImageryRaster(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.AVList
readMetadata(java.lang.Object source, AVList params)
Reads and returns the metadata from a data source.protected java.lang.String
validateMetadata(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:
getDescription
in interfaceDataRasterReader
-
getMimeTypes
public java.lang.String[] getMimeTypes()
-
getSuffixes
public java.lang.String[] getSuffixes()
- Specified by:
getSuffixes
in 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:File
String
InputStream
URL
- Specified by:
canRead
in 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:File
String
InputStream
URL
- Specified by:
read
in 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:File
String
InputStream
URL
- Specified by:
readMetadata
in 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:File
String
InputStream
URL
- Specified by:
isImageryRaster
in 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:File
String
InputStream
URL
- Specified by:
isElevationsRaster
in 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.
-
-