Package geomss.geom.reader
Class CARDGeomReader
- java.lang.Object
-
- geomss.geom.reader.AbstractGeomReader
-
- geomss.geom.reader.CARDGeomReader
-
- All Implemented Interfaces:
GeomReader,java.lang.Comparable
public class CARDGeomReader extends AbstractGeomReader
AGeomReaderfor reading and writing vehicle geometry from/to an APAS II (Airplane Preliminary Analysis System) CARD formatted geometry file.Modified by: Joseph A. Huwaldt
- Version:
- September 9, 2016
- Author:
- Joseph A. Huwaldt, Date: May 27, 2009
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXTENSION-
Fields inherited from interface geomss.geom.reader.GeomReader
MAYBE, NO, YES
-
-
Constructor Summary
Constructors Constructor Description CARDGeomReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcanReadData(java.io.File inputFile)Method that determines if this reader can read geometry from the specified input file.booleancanWriteData()Returns true.java.lang.StringgetExtension()Returns the preferred file extension (not including the ".") for files of this GeomReader's type.booleanisUnitAware()Returns true if this reader is unit aware and false if it is not.PointVehicleread(java.io.File inputFile)Reads in an APAS CARD formatted geometry file from the specified input file and returns aPointVehicleobject that contains the geometry from the file.java.lang.StringtoString()Returns a string representation of the object.voidwrite(java.io.File outputFile, GeometryList geometry)Writes out an APAS CARD geometry file for the geometry contained in the suppliedPointVehicleobject.-
Methods inherited from class geomss.geom.reader.AbstractGeomReader
compareTo, getWarnings, setFileUnits
-
-
-
-
Field Detail
-
EXTENSION
public static final java.lang.String EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CARDGeomReader
public CARDGeomReader()
-
-
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:
toStringin 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:
canReadDatain interfaceGeomReader- Overrides:
canReadDatain 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 has the extension ".geo" or ".mk5". GeomReader.MAYBE if the file has the extension ".lib".
- Throws:
java.io.IOException- if there is a problem reading from the specified file
-
canWriteData
public boolean canWriteData()
Returns true. This class can write point geometry to an APAS CARD formatted file.- Specified by:
canWriteDatain interfaceGeomReader- Overrides:
canWriteDatain classAbstractGeomReader- Returns:
- true
-
read
public PointVehicle read(java.io.File inputFile) throws java.io.IOException
Reads in an APAS CARD formatted geometry file from the specified input file and returns aPointVehicleobject that contains the geometry from the file.- Specified by:
readin interfaceGeomReader- Overrides:
readin classAbstractGeomReader- Parameters:
inputFile- The input file containing the geometry to be read in. May not be null.- Returns:
- A
PointVehicleobject 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)
-
write
public void write(java.io.File outputFile, GeometryList geometry) throws java.io.IOException
Writes out an APAS CARD geometry file for the geometry contained in the suppliedPointVehicleobject.- Specified by:
writein interfaceGeomReader- Overrides:
writein classAbstractGeomReader- Parameters:
outputFile- The output File to which the geometry is to be written. May not be null.geometry- ThePointVehicleobject to be written out. May not be null.- Throws:
java.io.IOException- If there is a problem writing to the specified file.
-
isUnitAware
public boolean isUnitAware()
Returns true if this reader is unit aware and false if it is not. APAS CARD files are unit aware and this method returns true.- Returns:
- this implementation always returns true.
- See Also:
GeomReader.setFileUnits(javax.measure.unit.Unit)
-
-