GeoTessJavaExamples  2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gov.sandia.geotess.examples.GeoTessModelExtended Class Reference

This class is an example of a class that extends GeoTessModel. More...

Inheritance diagram for gov.sandia.geotess.examples.GeoTessModelExtended:

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...
 

Detailed Description

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.

Author
sballar

Definition at line 79 of file GeoTessModelExtended.java.

Constructor & Destructor Documentation

◆ GeoTessModelExtended() [1/10]

gov.sandia.geotess.examples.GeoTessModelExtended.GeoTessModelExtended ( )

Definition at line 88 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [2/10]

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.

Parameters
modelInputFilename of file containing the model.
relativeGridPaththe 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.
Exceptions
IOException

Definition at line 116 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [3/10]

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.

Parameters
modelInputFilename of file containing the model.
Exceptions
IOException

Definition at line 135 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [4/10]

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.

Parameters
modelInputFilename of file containing the model.
relativeGridPaththe 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.
Exceptions
IOException

Definition at line 163 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [5/10]

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.

Parameters
modelInputFilename of file containing the model.
Exceptions
IOException

Definition at line 182 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [6/10]

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.

Parameters
inputStream
Exceptions
GeoTessException
IOException

Definition at line 196 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [7/10]

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.

Parameters
inputScanner
Exceptions
GeoTessException
IOException

Definition at line 210 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [8/10]

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:

  • setDescription()
  • setLayerNames()
  • setAttributes()
  • setDataType()
  • setLayerTessIds() (only required if grid has more than one multi-level tessellation)
Parameters
gridFileNamename of file from which to load the grid.
metaDataMetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made.
Exceptions
IOException

Definition at line 244 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [9/10]

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:

  • setDescription()
  • setLayerNames()
  • setAttributes()
  • setDataType()
  • setLayerTessIds() (only required if grid has more than one multi-level tessellation)
  • setSoftwareVersion()
  • setGenerationDate()
Parameters
grida reference to the GeoTessGrid that will support this GeoTessModel.
metaDataMetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made.
Exceptions
GeoTessExceptionif metadata is incomplete.

Definition at line 282 of file GeoTessModelExtended.java.

◆ GeoTessModelExtended() [10/10]

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.

Parameters
baseModel
Exceptions
GeoTessException

Definition at line 297 of file GeoTessModelExtended.java.

Member Function Documentation

◆ equals()

boolean gov.sandia.geotess.examples.GeoTessModelExtended.equals ( Object  other)

Definition at line 334 of file GeoTessModelExtended.java.

◆ getExtraData()

String gov.sandia.geotess.examples.GeoTessModelExtended.getExtraData ( )

Getter.

Returns
extraData

Definition at line 319 of file GeoTessModelExtended.java.

◆ initializeData()

void gov.sandia.geotess.examples.GeoTessModelExtended.initializeData ( )
protected

Protected method to initialize extraData.


Definition at line 310 of file GeoTessModelExtended.java.

◆ loadModelAscii()

void gov.sandia.geotess.examples.GeoTessModelExtended.loadModelAscii ( Scanner  input,
String  inputDirectory,
String  relGridFilePath 
) throws GeoTessException, IOException
protected

Overridden IO method.

Definition at line 404 of file GeoTessModelExtended.java.

◆ loadModelBinary()

void gov.sandia.geotess.examples.GeoTessModelExtended.loadModelBinary ( DataInputStream  input,
String  inputDirectory,
String  relGridFilePath 
) throws GeoTessException, IOException
protected

Overridden IO method.

Definition at line 345 of file GeoTessModelExtended.java.

◆ setExtraData()

void gov.sandia.geotess.examples.GeoTessModelExtended.setExtraData ( String  extraData)

Setter.

Parameters
extraData

Definition at line 328 of file GeoTessModelExtended.java.

◆ writeModelAscii()

void gov.sandia.geotess.examples.GeoTessModelExtended.writeModelAscii ( Writer  output,
String  gridFileName 
) throws IOException
protected

Overridden IO method.

Definition at line 438 of file GeoTessModelExtended.java.

◆ writeModelBinary()

void gov.sandia.geotess.examples.GeoTessModelExtended.writeModelBinary ( DataOutputStream  output,
String  gridFileName 
) throws IOException
protected

Overridden IO method.

Definition at line 380 of file GeoTessModelExtended.java.

Member Data Documentation

◆ extraData

String gov.sandia.geotess.examples.GeoTessModelExtended.extraData = "default value"
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.


The documentation for this class was generated from the following file: