GeoTessJavaExamples
2.0
|
This class is an example of a class that extends GeoTessModel. More...
Public Member Functions | |
GeoTessModelExtended () | |
GeoTessModelExtended (DataInputStream inputStream) throws GeoTessException, IOException | |
Construct a new GeoTessModelExtended object and populate it with information from the specified DataInputStream. More... | |
GeoTessModelExtended (File modelInputFile) throws IOException | |
Construct a new GeoTessModel object and populate it with information from the specified file. More... | |
GeoTessModelExtended (File modelInputFile, String relativeGridPath) throws IOException | |
Construct a new GeoTessModel object and populate it with information from the specified file. More... | |
GeoTessModelExtended (GeoTessGrid grid, GeoTessMetaData metaData) throws GeoTessException, IOException | |
Parameterized constructor, specifying the grid and metadata for the model. More... | |
GeoTessModelExtended (GeoTessModel baseModel) throws GeoTessException | |
Construct a new GeoTessModelExtended with all the structures from the supplied baseModel. More... | |
GeoTessModelExtended (Scanner inputScanner) throws GeoTessException, IOException | |
Construct a new GeoTessModelExtended object and populate it with information from the specified Scanner. More... | |
GeoTessModelExtended (String gridFileName, GeoTessMetaData metaData) throws IOException | |
Parameterized constructor, specifying the grid and metadata for the model. More... | |
GeoTessModelExtended (String modelInputFile) throws IOException | |
Construct a new GeoTessModel object and populate it with information from the specified file. More... | |
GeoTessModelExtended (String modelInputFile, String relativeGridPath) throws IOException | |
Construct a new GeoTessModel object and populate it with information from the specified file. More... | |
boolean | equals (Object other) |
String | getExtraData () |
Getter. More... | |
void | setExtraData (String extraData) |
Setter. More... | |
Protected Member Functions | |
void | initializeData () |
Protected method to initialize extraData. More... | |
void | loadModelAscii (Scanner input, String inputDirectory, String relGridFilePath) throws GeoTessException, IOException |
Overridden IO method. More... | |
void | loadModelBinary (DataInputStream input, String inputDirectory, String relGridFilePath) throws GeoTessException, IOException |
Overridden IO method. More... | |
void | writeModelAscii (Writer output, String gridFileName) throws IOException |
Overridden IO method. More... | |
void | writeModelBinary (DataOutputStream output, String gridFileName) throws IOException |
Overridden IO method. More... | |
Protected Attributes | |
String | extraData = "default value" |
This string is just an example that represents whatever extra data users application may require. More... | |
This class is an example of a class that extends GeoTessModel.
It inherits all the functionality of GeoTessModel but adds an extra data item to the model. In this example, the extra data is just a simple String, but in real models that extend GeoTessModel, it could be anything.
Classes that extend GeoTessModel should provide implementations of all the GeoTessModel constructors and perform the following initialization functions (order is important!):
In addition, classes that extend GeoTessModel should override 4 IO functions: loadModelBinary(), writeModelBinary(), loadModelAscii() and writeModelAscii(). See examples below.
The first thing that these methods do is call the super class implementations to read/write the standard GeoTessModel information. After that, the methods may read/write the application specific data from/to the end of the standard GeoTessModel file.
Definition at line 79 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | ) |
Definition at line 88 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | File | modelInputFile, |
String | relativeGridPath | ||
) | throws IOException |
Construct a new GeoTessModel object and populate it with information from the specified file.
modelInputFile | name of file containing the model. |
relativeGridPath | the relative path from the directory where the model is stored to the directory where the grid is stored. Often, the model and grid are stored together in the same file in which case this parameter is ignored. Sometimes, however, the grid is stored in a separate file and only the name of the grid file (without path information) is stored in the model file. In this case, the code needs to know which directory to search for the grid file. The default is "" (empty string), which will cause the code to search for the grid file in the same directory in which the model file resides. Bottom line is that the default value is appropriate when the grid is stored in the same file as the model, or the model file is in the same directory as the model file. |
IOException |
Definition at line 116 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | File | modelInputFile | ) | throws IOException |
Construct a new GeoTessModel object and populate it with information from the specified file.
relativeGridPath is assumed to be "" (empty string), which is appropriate when the grid information is stored in the same file as the model or when the grid is stored in a separate file located in the same directory as the model file.
modelInputFile | name of file containing the model. |
IOException |
Definition at line 135 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | String | modelInputFile, |
String | relativeGridPath | ||
) | throws IOException |
Construct a new GeoTessModel object and populate it with information from the specified file.
modelInputFile | name of file containing the model. |
relativeGridPath | the relative path from the directory where the model is stored to the directory where the grid is stored. Often, the model and grid are stored together in the same file in which case this parameter is ignored. Sometimes, however, the grid is stored in a separate file and only the name of the grid file (without path information) is stored in the model file. In this case, the code needs to know which directory to search for the grid file. The default is "" (empty string), which will cause the code to search for the grid file in the same directory in which the model file resides. Bottom line is that the default value is appropriate when the grid is stored in the same file as the model, or the model file is in the same directory as the model file. |
IOException |
Definition at line 163 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | String | modelInputFile | ) | throws IOException |
Construct a new GeoTessModel object and populate it with information from the specified file.
relativeGridPath is assumed to be "" (empty string), which is appropriate when the grid information is stored in the same file as the model or when the grid is stored in a separate file located in the same directory as the model file.
modelInputFile | name of file containing the model. |
IOException |
Definition at line 182 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | DataInputStream | inputStream | ) | throws GeoTessException, IOException |
Construct a new GeoTessModelExtended object and populate it with information from the specified DataInputStream.
The GeoTessGrid will be read directly from the inputStream as well.
inputStream |
GeoTessException | |
IOException |
Definition at line 196 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | Scanner | inputScanner | ) | throws GeoTessException, IOException |
Construct a new GeoTessModelExtended object and populate it with information from the specified Scanner.
The GeoTessGrid will be read directly from the inputScanner as well.
inputScanner |
GeoTessException | |
IOException |
Definition at line 210 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | String | gridFileName, |
GeoTessMetaData | metaData | ||
) | throws IOException |
Parameterized constructor, specifying the grid and metadata for the model.
The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.
Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:
gridFileName | name of file from which to load the grid. |
metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made. |
IOException |
Definition at line 244 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | GeoTessGrid | grid, |
GeoTessMetaData | metaData | ||
) | throws GeoTessException, IOException |
Parameterized constructor, specifying the grid and metadata for the model.
The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.
Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:
grid | a reference to the GeoTessGrid that will support this GeoTessModel. |
metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made. |
GeoTessException | if metadata is incomplete. |
Definition at line 282 of file GeoTessModelExtended.java.
gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended | ( | GeoTessModel | baseModel | ) | throws GeoTessException |
Construct a new GeoTessModelExtended with all the structures from the supplied baseModel.
The new GeoTessModelExtended will be built with references to the GeoTessMetaData, GeoTessGrid and all the Profiles in the baseModel.
No copies are made. Changes to one will be reflected in the other.
All of the extraData will be set to default values.
baseModel |
GeoTessException |
Definition at line 297 of file GeoTessModelExtended.java.
boolean gov.sandia.geotess.examples.GeoTessModelExtended.equals | ( | Object | other | ) |
Definition at line 334 of file GeoTessModelExtended.java.
String gov.sandia.geotess.examples.GeoTessModelExtended.getExtraData | ( | ) |
|
protected |
|
protected |
Overridden IO method.
Definition at line 404 of file GeoTessModelExtended.java.
|
protected |
Overridden IO method.
Definition at line 345 of file GeoTessModelExtended.java.
void gov.sandia.geotess.examples.GeoTessModelExtended.setExtraData | ( | String | extraData | ) |
|
protected |
Overridden IO method.
Definition at line 438 of file GeoTessModelExtended.java.
|
protected |
Overridden IO method.
Definition at line 380 of file GeoTessModelExtended.java.
|
protected |
This string is just an example that represents whatever extra data users application may require.
Do not initialize extraData!
Definition at line 86 of file GeoTessModelExtended.java.