com.miginfocom.util.dates
Interface TimeSpan

All Superinterfaces:
java.lang.Comparable
All Known Subinterfaces:
Activity, ActivityView, DateRangeI, MutableDateRange
All Known Implementing Classes:
AbstractActivity, AbstractActivityView, DateRange, DefaultActivity, DefaultActivityView, GridRow, ImmutableDateRange

public interface TimeSpan
extends java.lang.Comparable

Interface to be implemented by all classes that in some way represents an object that takes up some time, or rather has a start and end date/time.


Method Summary
 MutableDateRange getDateRangeClone()
          Returns the date range that the object spans as a clone which is safe to change without chaning the original time span.
 DateRangeI getDateRangeForReading()
          Returns the date range that the object spans.
 MutableDateRange getWritableDateRange()
          Returns the contained date range for editing.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getDateRangeClone

MutableDateRange getDateRangeClone()
Returns the date range that the object spans as a clone which is safe to change without chaning the original time span. If the range is only to be read from use getDateRangeForReading() instead to avoid unnecessary object cloning.

Returns:
Returns the date range that the object spans.

getDateRangeForReading

DateRangeI getDateRangeForReading()
Returns the date range that the object spans. If the object contains an immutable date range or a range that must not be changed that is returned here. In order to get a truly immutable date range that will not change call DateRangeI.getImmutable() on the returned range. The contract is to not change the returned date range.

Returns:
Returns the date range that the object spans.

getWritableDateRange

MutableDateRange getWritableDateRange()
Returns the contained date range for editing. If the local date range isn't allowed to be edited an UnsupportedOperationException should be thrown.

Returns:
The contained date range for editing.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.