Package geomss.geom.reader
Class GGPGeomReader
- java.lang.Object
-
- geomss.geom.reader.AbstractGeomReader
-
- geomss.geom.reader.GGPGeomReader
-
- All Implemented Interfaces:
GeomReader
,java.lang.Comparable
public class GGPGeomReader extends AbstractGeomReader
AGeomReader
for reading vehicle geometry from a GGP formatted geometry file. This is a geometry file format often used in conjunction with solution output from A502 (PANAIR) and A633 (TRANAIR). This class will only read in parameters from the GGP file with the names "X", "Y", and "Z". All other parameters are ignored. This class also assumes that all the parameters are contained in a single line and that the 1st format is duplicated throughout the file.Modified by: Joseph A. Huwaldt
- Version:
- July 3, 2019
- Author:
- Joseph A. Huwaldt, Date: May 11, 2000
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXTENSION
-
Fields inherited from interface geomss.geom.reader.GeomReader
MAYBE, NO, YES
-
-
Constructor Summary
Constructors Constructor Description GGPGeomReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
canReadData(java.io.File inputFile)
Method that determines if this reader can read geometry from the specified input file.java.lang.String
getExtension()
Returns the preferred file extension (not including the ".") for files of this GeomReader's type.boolean
isUnitAware()
This method always returnsfalse
as GGP files do not encode the units that are being used.PointVehicle
read(java.io.File inputFile)
Reads in a GGP formatted geometry file from the specified input file and returns aPointVehicle
object that contains the geometry from the GGP file.java.lang.String
toString()
Returns a string representation of the object.-
Methods inherited from class geomss.geom.reader.AbstractGeomReader
canWriteData, compareTo, getWarnings, setFileUnits, write
-
-
-
-
Field Detail
-
EXTENSION
public static final java.lang.String EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GGPGeomReader
public GGPGeomReader()
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of the object. This will return a brief description of the format read by this reader.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A brief description of the format read by this reader.
-
getExtension
public java.lang.String getExtension()
Returns the preferred file extension (not including the ".") for files of this GeomReader's type.- Returns:
- The preferred file extension for files of this readers type.
-
canReadData
public int canReadData(java.io.File inputFile) throws java.io.IOException
Method that determines if this reader can read geometry from the specified input file.- Specified by:
canReadData
in interfaceGeomReader
- Overrides:
canReadData
in classAbstractGeomReader
- Parameters:
inputFile
- The input file containing the geometry to be read in. May not be null.- Returns:
- GeomReader.NO if the file format is not recognized by this reader. GeomReader.YES if the file format is definitely recognized by this reader. GeomReader.MAYBE if the file format might be readable by this reader, but that can't easily be determined without actually reading the file.
- Throws:
java.io.IOException
- If there is a problem reading from the specified file.
-
read
public PointVehicle read(java.io.File inputFile) throws java.io.IOException
Reads in a GGP formatted geometry file from the specified input file and returns aPointVehicle
object that contains the geometry from the GGP file.A GGP file does not support multiple components, therefore, the vehicle returned will always contain a single component (or none at all if there was no data in the file).
WARNING: This file format is not unit aware. You must set the units to be used by calling "setFileUnits()" before calling this method!
- Specified by:
read
in interfaceGeomReader
- Overrides:
read
in classAbstractGeomReader
- Parameters:
inputFile
- The input file containing the geometry to be read in. May not be null.- Returns:
- A
PointVehicle
object containing the geometry read in from the file. If the file has no geometry in it, then this list will have no components in it (will have a size() of zero). - Throws:
java.io.IOException
- If there is a problem reading the specified file.- See Also:
AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
-
isUnitAware
public boolean isUnitAware()
This method always returnsfalse
as GGP files do not encode the units that are being used. You must callsetFileUnits
to set the units being used before reading from a file of this format.- Returns:
- true if this reader (and its format) is unit aware.
- See Also:
AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
-
-