|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- A datable type this class should generate.public interface Datable<T extends Datable<? super T>>
A datable object is an object that represents a date in Silverpeas, whatever it is. It can be a simple date (day in month in year) or a more complete one like a date time. Dates and datetimes are differents types as they don't have any instances in common, but they are part of the same types class. As Java doesn't support the trait concept from which a polymorphic familly of types can be modeled, the datable class is here introduced by a Java interface with a generic type. Datable can be then considered as a type generator that satisfy a bound constraint (a fix point).
Field Summary | |
---|---|
static String |
ICAL_PATTERN
The pattern for the iCal date representation in the current time zone of the datable. |
static String |
ICAL_UTC_PATTERN
The pattern for the iCal date representation in UTC. |
static String |
ISO_8601_PATTERN
The pattern for the ISO 8601 date representation. |
static String |
SHORT_ISO_8601_PATTERN
The pattern for the short ISO 8601 date representation. |
Method Summary | |
---|---|
T |
addDays(int amount)
Adds a number of days to the datable instance returning a new one. |
T |
addHours(int amount)
Adds a number of hours to the datable instance returning a new one. |
T |
addMilliseconds(int amount)
Adds a number of milliseconds to the datable instance returning a new one. |
T |
addMinutes(int amount)
Adds a number of minutes to the datable instance returning a new one. |
T |
addMonths(int amount)
Adds a number of months to the datable instance returning a new one. |
T |
addSeconds(int amount)
Adds a number of seconds to the datable instance returning a new one. |
T |
addWeeks(int amount)
Adds a number of weeks to the datable instance returning a new one. |
T |
addYears(int amount)
Adds a number of years to the datable instance returning a new one. |
Date |
asDate()
Gets the java Date representation of this datable. |
T |
clone()
Clones itself. |
T |
getBeginOfDay()
Computes first hour, minute, second, millisecond from the datable instance. |
T |
getBeginOfMonth()
Compute the first hour, minute, second, millisecond from the datable instance. |
T |
getBeginOfWeek()
Compute the first hour, minute, second, millisecond from the datable instance. |
T |
getBeginOfWeek(String locale)
Compute the first hour, minute, second, millisecond from the datable instance and a given locale. |
T |
getBeginOfYear()
Compute the first hour, minute, second, millisecond from the datable instance. |
T |
getEndOfDay()
Computes first hour, minute, second, millisecond from the datable instance. |
T |
getEndOfMonth()
Compute the date of the first day in the month from the datable instance. |
T |
getEndOfWeek()
Compute the date of the first day in the week from the datable instance. |
T |
getEndOfWeek(String locale)
Compute the date of the first day in the week from the datable instance and a given locale. |
T |
getEndOfYear()
Compute the date of the first day in the year from the datable instance. |
TimeData |
getTimeDataTo(T anotherDatable)
Compute the time between the datable instance and another one. |
TimeZone |
getTimeZone()
Gets the time zone for which this datable is defined. |
T |
inTimeZone(TimeZone timeZone)
Sets the time zone this datable is defined for. |
boolean |
isAfter(T anotherDatable)
Is this datable strictly after in time the specified another one? |
boolean |
isBefore(T anotherDatable)
Is this datable strictly before in time the specified another one? |
boolean |
isDefined()
Indicates is the date is different from DateUtil.MINIMUM_DATE or
DateUtil.MAXIMUM_DATE . |
boolean |
isEqualTo(T anotherDatable)
Is this datable equal in time to the specified another one? |
boolean |
isNotDefined()
Indicates the opposite of isDefined() |
String |
toICal()
Gets the ISO 8601 textual representation of this date as it is in the iCal specification. |
String |
toICalInUTC()
Gets the ISO 8601 textual representation of this date as it is in the iCal specification. |
String |
toISO8601()
Gets an ISO 8601 textual representation of this datable by taking into account of its underlying timezone. |
String |
toShortISO8601()
Gets an ISO 8601 textual representation of this datable by taking into account of its underlying timezone. |
Field Detail |
---|
static final String SHORT_ISO_8601_PATTERN
static final String ISO_8601_PATTERN
static final String ICAL_PATTERN
static final String ICAL_UTC_PATTERN
Method Detail |
---|
T clone()
Date asDate()
boolean isBefore(T anotherDatable)
anotherDatable
- the another datable to which this is compared.
boolean isAfter(T anotherDatable)
anotherDatable
- the another datable to which this is compared.
boolean isEqualTo(T anotherDatable)
anotherDatable
- the another datable to which this is compared.
T inTimeZone(TimeZone timeZone)
timeZone
- the time zone of this datable.
TimeZone getTimeZone()
String toISO8601()
String toShortISO8601()
String toICal()
String toICalInUTC()
T getBeginOfDay()
T getEndOfDay()
T getBeginOfWeek()
T getEndOfWeek()
T getBeginOfWeek(String locale)
T getEndOfWeek(String locale)
T getBeginOfMonth()
T getEndOfMonth()
T getBeginOfYear()
T getEndOfYear()
TimeData getTimeDataTo(T anotherDatable)
TimeData
.T addYears(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addMonths(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addWeeks(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addDays(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addHours(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addMinutes(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addSeconds(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedT addMilliseconds(int amount)
Datable
is unchanged.
amount
- the amount to add, may be negative
Datable
with the amount addedboolean isDefined()
DateUtil.MINIMUM_DATE
or
DateUtil.MAXIMUM_DATE
.
boolean isNotDefined()
isDefined()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |