1 | /* |
---|
2 | * $Id: TimePoint.java,v 1.4 2003/08/22 23:02:40 dwd Exp $ |
---|
3 | * |
---|
4 | * This software is provided by NOAA for full, free and open release. It is |
---|
5 | * understood by the recipient/user that NOAA assumes no liability for any |
---|
6 | * errors contained in the code. Although this software is released without |
---|
7 | * conditions or restrictions in its use, it is expected that appropriate |
---|
8 | * credit be given to its author and to the National Oceanic and Atmospheric |
---|
9 | * Administration should the software be included by the recipient as an |
---|
10 | * element in other product development. |
---|
11 | */ |
---|
12 | |
---|
13 | package gov.noaa.pmel.util; |
---|
14 | |
---|
15 | /** |
---|
16 | * TimePoint allows specification of a time-space point. |
---|
17 | * |
---|
18 | * @author Donald Denbo |
---|
19 | * @version $Revision: 1.4 $, $Date: 2003/08/22 23:02:40 $ |
---|
20 | * @since sgt 1.0 |
---|
21 | * |
---|
22 | * @deprecated As of sgt 3.0, replaced by {@link gov.noaa.pmel.util.SoTPoint SoTPoint}. |
---|
23 | */ |
---|
24 | public class TimePoint { |
---|
25 | /** Space coordinate */ |
---|
26 | public double x; |
---|
27 | /** Time coordinate */ |
---|
28 | public GeoDate t; |
---|
29 | /** |
---|
30 | * Default constructor. |
---|
31 | */ |
---|
32 | public TimePoint() { |
---|
33 | } |
---|
34 | /** |
---|
35 | * Construct a TimePoint. |
---|
36 | * |
---|
37 | * @param x space coordinate |
---|
38 | * @param t time coordinate |
---|
39 | */ |
---|
40 | public TimePoint(double x,GeoDate t) { |
---|
41 | this.x = x; |
---|
42 | this.t = t; |
---|
43 | } |
---|
44 | /** |
---|
45 | * Test for equality. Both x and t must be equal for equality. |
---|
46 | */ |
---|
47 | public boolean equals(TimePoint tp) { |
---|
48 | if(t != null && tp.t != null) { |
---|
49 | return (x == tp.x && t.equals(tp.t)); |
---|
50 | } else { |
---|
51 | return false; |
---|
52 | } |
---|
53 | } |
---|
54 | /** |
---|
55 | * Convert TimePoint to a default string |
---|
56 | * |
---|
57 | * @return string representation of the TimePoint. |
---|
58 | */ |
---|
59 | public String toString() { |
---|
60 | return new String("(" + x + ", " + t.toString() + ")"); |
---|
61 | } |
---|
62 | } |
---|