|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.spatial.io.GeometryReader
public abstract class GeometryReader
An abstract superclass for reading and decoding of geometry objects. This class must be subclassed by classes that read geometries.
GeometryReader objects can normally read a specific format. When an input source is set (using the setInput method), it may be marked as "seek forward only". This setting means that geometries contained within the input source will only be read in order, possibly allowing the reader to avoid caching portions of the input containing data associated with geometries that have been read previously.
GeometryWriter
,
SpatialManager
Method Summary | |
---|---|
void |
abort()
Requests that any current read operation be aborted. |
void |
dispose()
Allows any resources held by this object to be released. |
java.lang.String |
getFormatName()
Returns a String identifying the format of the input source. |
java.lang.Object |
getInput()
Returns the InputStream or other Object previously set as the input source. |
int |
getMinIndex()
Returns the lowest valid index for reading a geometry. |
int |
getNumGeometries()
Returns the number of geometries available from the current input source. |
boolean |
isSeekForwardOnly()
Returns true if the current input source has been marked as seek forward only by passing true as the seekForwardOnly argument to the setInput method. |
Geometry |
read(int index)
Reads the geometry at position specified by index, using supplied arguments specified by args. |
abstract Geometry |
read(int index,
java.lang.Object[] args)
Reads the geometry at position specified by index, using supplied arguments specified by args. |
java.util.Iterator |
readAll(java.lang.Object[] args)
Returns an Iterator containing all the geometries, starting at the index given by getMinIndex, from the input source in the form of Geometry objects. |
boolean |
ready()
Tell whether this stream is ready to be read. |
void |
reset()
Restores the GeometryReader to its initial state. |
void |
setInput(java.lang.Object input)
Sets the input source to the specified InputStream or other Object. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly)
Sets the input source to the specified InputStream or other Object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void reset()
public void dispose()
public java.lang.String getFormatName()
This implementation returns an empty string.
public int getMinIndex()
public int getNumGeometries()
The default value, returned by this implementation, is 1.
public boolean isSeekForwardOnly()
public boolean ready() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic Geometry read(int index) throws java.io.IOException, SpatialException
This implementation returns read(index, null).
index
- the position in the current input source
java.lang.IllegalStateException
- if the input source has not been set
java.lang.IndexOutOfBoundsException
- if the supplied index is less
than the minimum accepted index
(index < getMinIndex()).
java.io.IOException
- if an error occurs during reading
SpatialException
- if a spatial data format error occurs
during readingpublic abstract Geometry read(int index, java.lang.Object[] args) throws java.io.IOException, SpatialException
Read arguments may optionally be supplied in args. If no read arguments are needed, then args is ignored.
index
- the position in the current input sourceargs
- array of Object holding arguments supplied
to this reader
java.lang.IllegalStateException
- if the input source has not been set
java.lang.IndexOutOfBoundsException
- if the supplied index is less
than the minimum accepted index
(index < getMinIndex()).
java.io.IOException
- if an error occurs during reading
SpatialException
- if a spatial data format error occurs
during readingpublic java.util.Iterator readAll(java.lang.Object[] args) throws java.io.IOException, SpatialException
args
- an array of objects to control the read operation
java.lang.IllegalStateException
- if the input source has not been set
java.io.IOException
- if an error occurs during reading
SpatialException
- if a spatial data format error occurs
during readingpublic void setInput(java.lang.Object input, boolean seekForwardOnly)
If seekForwardOnly parameter is true, then the value returned by getMinIndex is increased as each geometry or other object is read, otherwise getMinIndex will return the value passed by the last read operation if the case, or 0.
input
- the InputStream or other
Object to use as a data sourceseekForwardOnly
- if true, geometries may only
be read in ascending order from this input source.
java.lang.IllegalArgumentException
- if input is
not an acceptable instancegetInput()
public void setInput(java.lang.Object input)
This method is equivalent to setInput(input, false).
input
- the InputStream or other
Object to use as a data source
java.lang.IllegalArgumentException
- if input is
not an acceptable instancegetInput()
public java.lang.Object getInput()
setInput(java.lang.Object, boolean)
public void abort()
Readers should call clearAbortFlag at the beginning of each read, and poll the value of abortFlag during the read.
|
Spatial DataBlade JAVA API v8.21 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |