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

Diff of /classpath/java/sql/Time.java

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

revision 1.7 by mkoch, Sun Apr 6 09:17:55 2003 UTC revision 1.8 by cbj, Fri Apr 11 22:01:07 2003 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.sql;  package java.sql;
40    
41    import java.text.ParseException;
42  import java.text.SimpleDateFormat;  import java.text.SimpleDateFormat;
43    
44  /**  /**
# Line 55  public class Time extends java.util.Date Line 56  public class Time extends java.util.Date
56     */     */
57    private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");    private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
58    
59      /**
60       * This method always throws an IllegalArgumentException.
61       *
62       * @throws IllegalArgumentException when it's called.
63       * @deprecated
64       */
65      public int getDate() throws IllegalArgumentException {
66        throw new IllegalArgumentException();
67      }
68    
69      /**
70       * This method always throws an IllegalArgumentException.
71       *
72       * @throws IllegalArgumentException when it's called.
73       * @deprecated
74       */
75      public int getDay() throws IllegalArgumentException {
76        throw new IllegalArgumentException();
77      }
78    
79      /**
80       * This method always throws an IllegalArgumentException.
81       *
82       * @throws IllegalArgumentException when it's called.
83       * @deprecated
84       */
85      public int getMonth() throws IllegalArgumentException {
86        throw new IllegalArgumentException();
87      }
88    
89      /**
90       * This method always throws an IllegalArgumentException.
91       *
92       * @throws IllegalArgumentException when it's called.
93       * @deprecated
94       */
95      public int getYear() throws IllegalArgumentException {
96        throw new IllegalArgumentException();
97      }
98    
99      /**
100       * This method always throws an IllegalArgumentException.
101       *
102       * @throws IllegalArgumentException when it's called.
103       * @deprecated
104       */
105      public void setDate(int newValue) throws IllegalArgumentException {
106        throw new IllegalArgumentException();
107      }
108    
109      /**
110       * This method always throws an IllegalArgumentException.
111       *
112       * @throws IllegalArgumentException when it's called.
113       * @deprecated
114       */
115      public void setMonth(int newValue) throws IllegalArgumentException {
116        throw new IllegalArgumentException();
117      }
118    
119      /**
120       * This method always throws an IllegalArgumentException.
121       *
122       * @throws IllegalArgumentException when it's called.
123       * @deprecated
124       */
125      public void setYear(int newValue) throws IllegalArgumentException {
126        throw new IllegalArgumentException();
127      }
128    
129    /**    /**
130     * This method returns a new instance of this class by parsing a     * This method returns a new instance of this class by parsing a
# Line 70  public class Time extends java.util.Date Line 140  public class Time extends java.util.Date
140      try      try
141        {        {
142          java.util.Date d = (java.util.Date) sdf.parseObject(str);          java.util.Date d = (java.util.Date) sdf.parseObject(str);
143          return new Time(d.getTime());  
144            if (d == null) {
145              throw new IllegalArgumentException(str);
146            }
147            else {
148              return new Time(d.getTime());
149            }
150        }        }
151      catch (Exception e)      catch (ParseException e)
152        {        {
153          return null;          throw new IllegalArgumentException(str);
154        }        }
155    }    }
156    

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

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