1 |
/* Time.java -- Wrapper around java.util.Date |
/* Time.java -- Wrapper around java.util.Date |
2 |
Copyright (C) 1999, 2000 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
52 |
*/ |
*/ |
53 |
public class Timestamp extends java.util.Date |
public class Timestamp extends java.util.Date |
54 |
{ |
{ |
55 |
static final long serialVersionUID = 3581463369166924961L; |
static final long serialVersionUID = 2745179027874758501L; |
56 |
|
|
57 |
/** |
/** |
58 |
* Used for parsing and formatting this date. |
* Used for parsing and formatting this date. |
237 |
} |
} |
238 |
|
|
239 |
/** |
/** |
240 |
|
* Compare two Timestamp |
241 |
|
* @param when the other Timestamp. |
242 |
|
* @return 0, if the date represented |
243 |
|
* by obj is exactly the same as the time represented by this |
244 |
|
* object, a negative if this Timestamp is before the other Timestamp, and |
245 |
|
* a positive value otherwise. |
246 |
* @since 1.2 |
* @since 1.2 |
247 |
*/ |
*/ |
|
/* |
|
248 |
public int compareTo(Timestamp ts) |
public int compareTo(Timestamp ts) |
249 |
{ |
{ |
250 |
|
int s = super.compareTo((java.util.Date) ts); |
251 |
}*/ |
if (s != 0) |
252 |
|
return s; |
253 |
|
// If Date components were equal, then we check the nanoseconds. |
254 |
|
return nanos - ts.nanos; |
255 |
|
} |
256 |
|
|
257 |
/** |
/** |
258 |
|
* Compares this Timestamp to another. This behaves like |
259 |
|
* <code>compareTo(Timestamp)</code>, but it may throw a |
260 |
|
* <code>ClassCastException</code> |
261 |
|
* @param obj the other Timestamp. |
262 |
|
* @return 0, if the Timestamp represented |
263 |
|
* by obj is exactly the same as the time represented by this |
264 |
|
* object, a negative if this Timestamp is before the other Timestamp, and |
265 |
|
* a positive value otherwise. |
266 |
|
* @exception ClassCastException if obj is not of type Timestamp. |
267 |
* @since 1.2 |
* @since 1.2 |
268 |
*//* |
*/ |
269 |
public int compareTo(Object obj) |
public int compareTo(Object obj) |
270 |
{ |
{ |
271 |
return compareTo((Timestamp) obj); |
return compareTo((Timestamp) obj); |
272 |
}*/ |
} |
273 |
} |
} |