public abstract class SpatialFileReader
extends java.lang.Object
By extended this class, subclasses can provide geometrical data as well as attribute data on a row by row basis.
Modifier and Type | Field and Description |
---|---|
protected int |
geometryTypesFilter
The geometry types filter.
|
static java.lang.String |
READER_PARAM_FILES |
static java.lang.String |
READER_PARAM_LAYERS |
Constructor and Description |
---|
SpatialFileReader() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Frees the resources used by the reader implementation.
|
abstract Attribute[] |
getAttributeMetaData()
Gets the metadata associated with the data source.
|
abstract int |
getAvailableGeometryTypes() |
int |
getGeometryTypesFilter()
Returns the geometry types filter which is currently used.
|
abstract java.lang.String[] |
getLayers()
Returns an array of String that defines the layers found in the
SpatiaDataSource
|
abstract java.lang.String |
getName() |
abstract JMapGeoElement |
getNext()
Gets the next element from the data source.
|
protected static java.lang.String |
getNextColunmName(Attribute[] attributeMetaData)
Returns the next available name for the attributeMetaData.
|
abstract java.lang.String |
getParametersParserClassName() |
abstract java.lang.String[] |
getPaths(java.lang.String params)
Returns an array of String which defined the file paths used by the reader.
|
abstract long |
getTimeStamp()
Gets time stamp of the data file.
|
abstract java.lang.String |
getVersion() |
abstract boolean |
hasNext()
Determines if there are any more information to read using the
getNext method. |
protected static boolean |
isColunmNameExists(java.lang.String name,
Attribute[] attributeMetaData)
Returns whether Attribute already contains the specified name.
|
static SpatialFileReader |
loadReader(java.lang.String className) |
abstract void |
open(java.lang.String params)
This method opens the file for the specified layer and sets the its
parameters.
|
abstract void |
reset()
Resets the state of the reader so that the next call to
getNext will return the first element of the data source. |
void |
setGeometryTypesFilter(int geometryTypesFilter)
Sets the geometry types filter to use while reading a spatial file.
|
protected void |
validateMetaData(Attribute[] attribs1,
Attribute[] attribs2)
This method can be used to verify the equality between two Attribute
arrays.
|
public static final java.lang.String READER_PARAM_FILES
public static final java.lang.String READER_PARAM_LAYERS
protected int geometryTypesFilter
public abstract java.lang.String getName()
public abstract java.lang.String getVersion()
public abstract java.lang.String getParametersParserClassName()
public abstract void open(java.lang.String params) throws java.lang.Exception
params
- the string containing the parameters for the layer.java.lang.Exception
public abstract void reset() throws java.lang.Exception
getNext
will return the first element of the data source.java.lang.Exception
public abstract boolean hasNext() throws java.lang.Exception
getNext
method.public abstract JMapGeoElement getNext() throws java.lang.Exception
hasNext
.java.lang.Exception
hasNext()
,
reset()
,
JMapGeoElement
public abstract Attribute[] getAttributeMetaData() throws java.lang.Exception
java.lang.Exception
Attribute
public abstract long getTimeStamp() throws java.lang.Exception
java.lang.Exception
public abstract void close() throws java.lang.Exception
java.lang.Exception
public abstract java.lang.String[] getPaths(java.lang.String params)
params
- the parameters used to open the SpatialFileDatasourcepublic abstract java.lang.String[] getLayers() throws java.lang.Exception
java.lang.Exception
public abstract int getAvailableGeometryTypes() throws java.lang.Exception
java.lang.Exception
public int getGeometryTypesFilter()
public void setGeometryTypesFilter(int geometryTypesFilter)
geometryTypesFilter
- The geometryTypesFilter to set.protected void validateMetaData(Attribute[] attribs1, Attribute[] attribs2) throws java.lang.IllegalArgumentException
attribs1
- an array of Attribute objects.attribs2
- the array of Attribute objects that will be verified.java.lang.IllegalArgumentException
- if the two specified arrays don't contain
exactly the same attributes.public static SpatialFileReader loadReader(java.lang.String className)
protected static boolean isColunmNameExists(java.lang.String name, Attribute[] attributeMetaData)
Attribute
- the Array of Attributes to use.name
- the name to search.protected static java.lang.String getNextColunmName(Attribute[] attributeMetaData)
Attribute
- the Array of Attributes to search.