src/share/classes/javax/swing/SpinnerDateModel.java

Print this page

        

@@ -87,11 +87,11 @@
  * @since 1.4
  */
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 public class SpinnerDateModel extends AbstractSpinnerModel implements Serializable
 {
-    private Comparable start, end;
+    private Comparable<Date> start, end;
     private Calendar value;
     private int calendarField;
 
 
     private boolean calendarFieldOK(int calendarField) {

@@ -171,11 +171,11 @@
      * @see #setValue
      * @see #setStart
      * @see #setEnd
      * @see #setCalendarField
      */
-    public SpinnerDateModel(Date value, Comparable start, Comparable end, int calendarField) {
+    public SpinnerDateModel(Date value, Comparable<Date> start, Comparable<Date> end, int calendarField) {
         if (value == null) {
             throw new IllegalArgumentException("value is null");
         }
         if (!calendarFieldOK(calendarField)) {
             throw new IllegalArgumentException("invalid calendarField");

@@ -239,11 +239,11 @@
      * @param start defines the first date in the sequence
      * @see #getStart
      * @see #setEnd
      * @see #addChangeListener
      */
-    public void setStart(Comparable start) {
+    public void setStart(Comparable<Date> start) {
         if ((start == null) ? (this.start != null) : !start.equals(this.start)) {
             this.start = start;
             fireStateChanged();
         }
     }

@@ -253,11 +253,11 @@
      * Returns the first <code>Date</code> in the sequence.
      *
      * @return the value of the <code>start</code> property
      * @see #setStart
      */
-    public Comparable getStart() {
+    public Comparable<Date> getStart() {
         return start;
     }
 
 
     /**

@@ -280,11 +280,11 @@
      * @param end defines the last date in the sequence
      * @see #getEnd
      * @see #setStart
      * @see #addChangeListener
      */
-    public void setEnd(Comparable end) {
+    public void setEnd(Comparable<Date> end) {
         if ((end == null) ? (this.end != null) : !end.equals(this.end)) {
             this.end = end;
             fireStateChanged();
         }
     }

@@ -294,11 +294,11 @@
      * Returns the last <code>Date</code> in the sequence.
      *
      * @return the value of the <code>end</code> property
      * @see #setEnd
      */
-    public Comparable getEnd() {
+    public Comparable<Date> getEnd() {
         return end;
     }
 
 
     /**