/[classpath]/classpath/java/sql/Timestamp.java
ViewVC logotype

Diff of /classpath/java/sql/Timestamp.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by bryce, Fri Jun 21 05:34:12 2002 UTC revision 1.7 by tromey, Mon Feb 10 19:56:05 2003 UTC
# Line 1  Line 1 
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    
# Line 52  import java.text.SimpleDateFormat; Line 52  import java.text.SimpleDateFormat;
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.
# Line 237  public class Timestamp extends java.util Line 237  public class Timestamp extends java.util
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  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26