1 39 40 package org.jfree.data; 41 42 import java.text.DateFormat ; 43 import java.util.Date ; 44 45 53 public class DateRange extends Range { 54 55 56 private Date lowerDate; 57 58 59 private Date upperDate; 60 61 64 public DateRange() { 65 66 this(new Date (0), new Date (1)); 67 68 } 69 70 76 public DateRange(Date lower, Date upper) { 77 78 super(lower.getTime(), upper.getTime()); 79 this.lowerDate = lower; 80 this.upperDate = upper; 81 82 } 83 84 90 public DateRange(double lower, double upper) { 91 92 super(lower, upper); 93 this.lowerDate = new Date ((long) lower); 94 this.upperDate = new Date ((long) upper); 95 96 97 } 98 99 108 public DateRange(Range other) { 109 110 this(other.getLowerBound(), other.getUpperBound()); 111 112 } 113 114 119 public Date getLowerDate() { 120 return this.lowerDate; 121 } 122 123 128 public Date getUpperDate() { 129 return this.upperDate; 130 } 131 132 137 public String toString() { 138 DateFormat df = DateFormat.getDateTimeInstance(); 139 return "[" + df.format(this.lowerDate) + " --> " + df.format(this.upperDate) + "]"; 140 } 141 142 } 143 | Popular Tags |