public class XGSSGeomReader extends AbstractGeomReader
GeomReader
for reading geometry from an XGSS formatted, GZIP compressed, XML
geometry file. XGSS is the native file format for GeomSS.
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTENSION
The preferred file extension for files of this reader's type.
|
MAYBE, NO, YES
Constructor and Description |
---|
XGSSGeomReader() |
Modifier and Type | Method and Description |
---|---|
int |
canReadData(java.io.File inputFile)
Method that determines if this reader can read geometry from the specified input
file.
|
boolean |
canWriteData()
Returns
true . |
java.lang.String |
getExtension()
Returns the preferred file extension (not including the ".") for files of this
GeomReader's type.
|
boolean |
isUnitAware()
This method always returns
true as XGSS files do encode the units that
are being used for each geometry element. |
GeometryList |
read(java.io.File inputFile)
Reads in an XGSS geometry file from the specified input file and returns a
GeometryList object that contains the geometry from the file. |
java.util.Map<java.lang.String,java.lang.Object> |
readWorkspace(java.io.File inputFile)
Reads in an XGSS geometry + workspace file from the specified input file and
returns a Map object that contains the geometry and workspace variables from the
file with the variable names as the keys.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
write(java.io.File outputFile,
GeometryList geometry)
Writes out a geometry file for the geometry contained in the supplied
GeometryList object. |
void |
write(java.io.File outputFile,
java.util.Map<java.lang.String,GeomElement> geometry,
java.util.Map<java.lang.String,java.lang.Object> vars)
Writes out an XGSS geometry file for the and non-geometry workspace variables
contained in the supplied maps.
|
compareTo, getWarnings, setFileUnits
public static final java.lang.String EXTENSION
public XGSSGeomReader()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getExtension()
public boolean isUnitAware()
true
as XGSS files do encode the units that
are being used for each geometry element.GeomReader.setFileUnits(javax.measure.unit.Unit)
public int canReadData(java.io.File inputFile) throws java.io.IOException
canReadData
in interface GeomReader
canReadData
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in.java.io.IOException
- If there is a problem reading from the specified
file.public GeometryList read(java.io.File inputFile) throws java.io.IOException
GeometryList
object that contains the geometry from the file.read
in interface GeomReader
read
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in. May not be
null.GeometryList
object containing the geometry read in from the
file. If the file has no readable geometry in it, then this list will have
no elements in it (will have a size() of 0).java.io.IOException
- If there is a problem reading the specified file.AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
public boolean canWriteData()
true
. This reader can write all geometry element types to an
XGSS file.canWriteData
in interface GeomReader
canWriteData
in class AbstractGeomReader
public void write(java.io.File outputFile, GeometryList geometry) throws java.io.IOException
GeometryList
object.write
in interface GeomReader
write
in class AbstractGeomReader
outputFile
- The output File to which the geometry is to be written. May not
be null.geometry
- The GeometryList
object containing the geometry to be
written out. May not be null.java.io.IOException
- If there is a problem writing to the specified file.public void write(java.io.File outputFile, java.util.Map<java.lang.String,GeomElement> geometry, java.util.Map<java.lang.String,java.lang.Object> vars) throws java.io.IOException
outputFile
- The output File to which the geometry is to be written. May not
be null.geometry
- A map identifying geometry elements by their associated variable
names. May not be null.vars
- A map identifying non-geometry related workspace variables by
their variable names. May not be null.java.io.IOException
- If there is a problem writing to the specified file.public java.util.Map<java.lang.String,java.lang.Object> readWorkspace(java.io.File inputFile) throws java.io.IOException
inputFile
- The input file containing the geometry + workspace to be read in.java.io.IOException
- If there is a problem reading the specified file.