1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 package edu.sc.seis.TauP;
29
30 import java.util.Properties;
31
32 /***
33 * Outputs.java contains formating, similar to printf, routines for
34 * the output types in the TauP package.
35 *
36 *
37 * Created: Tue Sep 21 11:45:35 1999
38 *
39 * @author Philip Crotwell
40 * @version 1.1.3 Wed Jul 18 15:00:35 GMT 2001
41
42
43
44 */
45
46 public class Outputs {
47
48 public Outputs(Properties props) {
49 String formString;
50
51 formString = "%8."+props.getProperty("taup.depth.precision", "1")+"f";
52 depthFormat = new Format(formString);
53
54 formString ="%8."+props.getProperty("taup.distance.precision","2")+"f";
55 distanceFormat = new Format(formString);
56
57 formString = "%8."+props.getProperty("taup.time.precision", "2")+"f";
58 timeFormat = new Format(formString);
59
60 formString ="%8."+props.getProperty("taup.rayparam.precision","3")+"f";
61 rayParamFormat = new Format(formString);
62
63 formString ="%8."+props.getProperty("taup.latlon.precision","2")+"f";
64 latLonFormat = new Format(formString);
65 }
66
67 public String formatDepth(double depth) {
68 return depthFormat.form(depth);
69 }
70
71 public String formatDistance(double distance) {
72 return distanceFormat.form(distance);
73 }
74
75 public String formatTime(double time) {
76 return timeFormat.form(time);
77 }
78
79 public String formatRayParam(double rayParam) {
80 return rayParamFormat.form(rayParam);
81 }
82
83 public String formatLatLon(double latlon) {
84 return latLonFormat.form(latlon);
85 }
86
87 protected Format depthFormat;
88
89 protected Format distanceFormat;
90
91 protected Format timeFormat;
92
93 protected Format rayParamFormat;
94
95 protected Format latLonFormat;
96
97
98
99 }