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.io.Serializable;
31
32 /*** Convenience class for storing a depth range. It has a top and
33 * a bottom and can have an associated ray parameter.
34 *
35 * @version 1.1.3 Wed Jul 18 15:00:35 GMT 2001
36
37
38
39 * @author H. Philip Crotwell
40 */
41 public class DepthRange implements Serializable, Cloneable {
42
43 /*** Top of the depth range. */
44 public double topDepth;
45
46 /*** Bottom of the depth range. */
47 public double botDepth;
48
49 /*** rayParam associated with the depth range. If this were a
50 * high slowness depth range, then rayParam would be the
51 * largest ray parameter that would penetrate the depth range. */
52 public double rayParam = -1;
53
54 public DepthRange() {
55 }
56
57 public DepthRange(double topDepth, double botDepth) {
58 this.topDepth = topDepth;
59 this.botDepth = botDepth;
60 }
61
62 public DepthRange(double topDepth, double botDepth, double rayParam) {
63 this.topDepth = topDepth;
64 this.botDepth = botDepth;
65 this.rayParam = rayParam;
66 }
67
68 public Object clone() {
69 DepthRange newObject;
70 try {
71 newObject = (DepthRange)super.clone();
72 return newObject;
73 } catch (CloneNotSupportedException e) {
74
75 System.err.println("Caught CloneNotSupportedException: "+
76 e.getMessage());
77 throw new InternalError(e.toString());
78 }
79 }
80
81 public String toString() {
82 if (rayParam != -1) {
83 return "topDepth="+topDepth+" botDepth="+botDepth+
84 " rayParam="+rayParam;
85 } else {
86 return "topDepth="+topDepth+" botDepth="+botDepth;
87 }
88 }
89 }