1 package gov.sandia.geotess.examples.customdata;
3 import java.io.DataInputStream;
4 import java.io.DataOutputStream;
5 import java.io.IOException;
6 import java.util.HashMap;
7 import java.util.Scanner;
17 public class StationData extends HashMap<SeismicPhase, PhaseData>
55 delta = input.readDouble();
56 azimuth = input.readDouble();
57 backAzimuth = input.readDouble();
59 int nPhases = input.readInt();
61 for (
int i=0; i<nPhases; ++i)
64 put(phase,
new PhaseData(input, attributes));
76 public void write(DataOutputStream output,
78 output.writeDouble(delta);
79 output.writeDouble(azimuth);
80 output.writeDouble(backAzimuth);
82 output.writeInt(size());
83 for (Entry<SeismicPhase, PhaseData> entry : entrySet())
85 GeoTessUtils.writeString(output, entry.getKey().toString());
86 entry.getValue().write(output, attributes);
99 delta = input.nextDouble();
100 azimuth = input.nextDouble();
101 backAzimuth = input.nextDouble();
103 int nPhases = input.nextInt();
104 for (
int i=0; i<nPhases; ++i)
107 put(phase,
new PhaseData(input, attributes));
118 public void write(StringBuffer output,
120 output.append(Double.toString(delta)).append(
" ");
121 output.append(Double.toString(azimuth)).append(
" ");
122 output.append(Double.toString(backAzimuth)).append(
'\n');
124 for (Entry<SeismicPhase, PhaseData> entry : entrySet())
126 output.append(entry.getKey().toString()).append(
'\n');
127 entry.getValue().write(output, attributes);