View Javadoc

1   /*
2     The TauP Toolkit: Flexible Seismic Travel-Time and Raypath Utilities.
3     Copyright (C) 1998-2000 University of South Carolina
4   
5     This program is free software; you can redistribute it and/or
6     modify it under the terms of the GNU General Public License
7     as published by the Free Software Foundation; either version 2
8     of the License, or (at your option) any later version.
9   
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14  
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18  
19    The current version can be found at 
20    <A HREF="www.seis.sc.edu">http://www.seis.sc.edu</A>
21  
22    Bug reports and comments should be directed to 
23    H. Philip Crotwell, crotwell@seis.sc.edu or
24    Tom Owens, owens@seis.sc.edu
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           // Can't happen, but...
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  }