| java.lang.Object org.jdesktop.swing.calendar.DateSpan
DateSpan | public class DateSpan implements HasStartAndEnd(Code) | | An immutable representation of a time range. The time range is
internally represented as two longs. The methods that take and return
Date s create the Date s as needed, so that
if you modify returned Date s you will not effect
the DateSpan . The end points are inclusive.
version: $Revision: 1.1 $ |
Constructor Summary | |
public | DateSpan(long start, long end) Creates a DateSpan between the two end points. | public | DateSpan(Date start, Date end) Creates a DateSpan between the two end points. |
Method Summary | |
public DateSpan | add(DateSpan span) Returns a new DateSpan that is the union of this
DateSpan and span . | public DateSpan | add(long start, long end) Returns a new DateSpan that is the union of this
DateSpan and the passed in span. | public boolean | contains(DateSpan span) Returns true if this DateSpan contains the specified
DateSpan . | public boolean | contains(long time) Returns whether or not this DateSpan contains the specified
time. | public boolean | contains(long start, long end) Returns whether or not this DateSpan contains the
specified date span. | public boolean | equals(Object o) | public long | getEnd() Returns the end of the date span. | public Date | getEndAsDate() Returns the end of the date span as a Date . | public long | getStart() Returns the start of the date span. | public Date | getStartAsDate() Returns the start of the date span as a Date . | public int | hashCode() | public boolean | intersects(long start, long end) Returns true if the this DateSpan intersects with the
specified time. | public boolean | intersects(DateSpan span) Returns true if the this DateSpan intersects with the
specified DateSpan . | public String | toString() |
DateSpan | public DateSpan(long start, long end)(Code) | | Creates a DateSpan between the two end points.
Parameters: start - Beginning date Parameters: end - Ending date throws: IllegalArgumentException - if start is afterend |
DateSpan | public DateSpan(Date start, Date end)(Code) | | Creates a DateSpan between the two end points. This
is a conveniance constructor that is equivalent to
new Date(start.getTime(), end.getTime()); .
Parameters: start - Beginning date Parameters: end - Ending date |
add | public DateSpan add(DateSpan span)(Code) | | Returns a new DateSpan that is the union of this
DateSpan and span .
Parameters: span - DateSpan to add union of this DateSpan and span |
add | public DateSpan add(long start, long end)(Code) | | Returns a new DateSpan that is the union of this
DateSpan and the passed in span.
Parameters: start - Start of region to add Parameters: end - End of region to end union of this DateSpan and start , end |
contains | public boolean contains(DateSpan span)(Code) | | Returns true if this DateSpan contains the specified
DateSpan .
Parameters: span - Date to check true if this DateSpan contains span . |
contains | public boolean contains(long time)(Code) | | Returns whether or not this DateSpan contains the specified
time.
Parameters: time - time check true if this DateSpan contains time . |
contains | public boolean contains(long start, long end)(Code) | | Returns whether or not this DateSpan contains the
specified date span.
Parameters: start - Start of time span Parameters: end - End of time true if this DateSpan contains the specifieddate span. |
getEnd | public long getEnd()(Code) | | Returns the end of the date span.
end of the span. |
getEndAsDate | public Date getEndAsDate()(Code) | | Returns the end of the date span as a Date .
end of the span. |
getStart | public long getStart()(Code) | | Returns the start of the date span.
start of the span. |
getStartAsDate | public Date getStartAsDate()(Code) | | Returns the start of the date span as a Date .
start of the span. |
hashCode | public int hashCode()(Code) | | |
intersects | public boolean intersects(long start, long end)(Code) | | Returns true if the this DateSpan intersects with the
specified time.
Parameters: start - Start time Parameters: end - End time true if this DateSpan intersects with the specifiedtime. |
intersects | public boolean intersects(DateSpan span)(Code) | | Returns true if the this DateSpan intersects with the
specified DateSpan .
Parameters: span - DateSpan to compare to true if this DateSpan intersects with the specifiedtime. |
|
|