36 package gov.sandia.geotess.examples;
38 import java.io.DataInputStream;
39 import java.io.DataOutputStream;
41 import java.io.IOException;
42 import java.io.Writer;
43 import java.util.Scanner;
119 loadModel(modelInputFile, relativeGridPath);
138 loadModel(modelInputFile,
"");
166 loadModel(modelInputFile, relativeGridPath);
185 loadModel(modelInputFile,
"");
246 super(gridFileName, metaData);
284 super(grid, metaData);
299 super(baseModel.getGrid(), baseModel.getMetaData());
300 for (
int i = 0; i < baseModel.getNVertices(); ++i)
301 for (
int j=0; j<baseModel.getNLayers(); ++j)
302 setProfile(i,j,baseModel.getProfile(i, j));
312 extraData =
"extraData initialized in GeoTessModelExtended.initializeData()";
338 return super.
equals(otherModel) && this.extraData.equals(otherModel.
extraData);
346 String inputDirectory, String relGridFilePath)
347 throws GeoTessException, IOException
350 super.loadModelBinary(input, inputDirectory, relGridFilePath);
354 String className = GeoTessUtils.readString(input);
355 if (!className.equals(
this.getClass().getSimpleName()))
356 throw new IOException(
"Found class name "+className
358 +this.getClass().getSimpleName());
364 int formatVersion = input.readInt();
366 if (formatVersion == 1)
369 throw new IOException(
"Format version "+formatVersion+
" is not supported.");
372 extraData = GeoTessUtils.readString(input);
384 super.writeModelBinary(output, gridFileName);
388 GeoTessUtils.writeString(output, this.getClass().getSimpleName());
397 GeoTessUtils.writeString(output,
extraData);
405 String relGridFilePath)
throws GeoTessException, IOException
407 super.loadModelAscii(input, inputDirectory, relGridFilePath);
411 String className = input.nextLine();
412 if (!className.equals(
this.getClass().getSimpleName()))
413 throw new IOException(
"Found class name "+className
415 +this.getClass().getSimpleName());
421 int formatVersion = input.nextInt();
424 if (formatVersion == 1)
427 throw new IOException(
"Format version "+formatVersion+
" is not supported.");
442 super.writeModelAscii(output, gridFileName);
449 output.write(String.format(
"%s%n%d%n",
this.getClass().getSimpleName(), 1));