Package org.silverpeas.core.date
Interface Temporal<T extends Temporal<? super T>>
-
- Type Parameters:
T
- A temporal type this class should generate.
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
AbstractDateTemporal
,Date
,DateTime
@Deprecated public interface Temporal<T extends Temporal<? super T>> extends Cloneable
Deprecated.Use the java.time APIWARNING: All the deprecated classes in this package contain failure in their handling of date times (bad use of Timezone, etc.) A temporal object is an object that represents an instant in a time line in Silverpeas. This instant can be a date (day in month in year), a time or a datetime.Date, time, and datetime are different 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 class type concept from which a polymorphic family of types can be modeled, the temporal class is here introduced by a Java interface with a generic type. Temporal can be then considered as a type generator that satisfies a bound constraint (a fix point).
-
-
Field Summary
Fields Modifier and Type Field Description static String
ICAL_PATTERN
Deprecated.The pattern for the iCal date representation in the current time zone of the temporal.static String
ICAL_UTC_PATTERN
Deprecated.The pattern for the iCal date representation in UTC.static String
ISO_8601_PATTERN
Deprecated.The pattern for the ISO 8601 date representation.static String
SHORT_ISO_8601_PATTERN
Deprecated.The pattern for the short ISO 8601 date representation.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description T
addDays(int amount)
Deprecated.Adds a number of days to the temporal instance returning a new one.T
addHours(int amount)
Deprecated.Adds a number of hours to the temporal instance returning a new one.T
addMilliseconds(int amount)
Deprecated.Adds a number of milliseconds to the temporal instance returning a new one.T
addMinutes(int amount)
Deprecated.Adds a number of minutes to the temporal instance returning a new one.T
addMonths(int amount)
Deprecated.Adds a number of months to the temporal instance returning a new one.T
addSeconds(int amount)
Deprecated.Adds a number of seconds to the temporal instance returning a new one.T
addWeeks(int amount)
Deprecated.Adds a number of weeks to the temporal instance returning a new one.T
addYears(int amount)
Deprecated.Adds a number of years to the temporal instance returning a new one.Date
asDate()
Deprecated.Gets the java Date representation of this temporal.T
clone()
Deprecated.Clones itself.T
getBeginOfDay()
Deprecated.Computes first hour, minute, second, millisecond from the temporal instance.T
getBeginOfMonth()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.T
getBeginOfWeek()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.T
getBeginOfWeek(String locale)
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance and a given locale.T
getBeginOfYear()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.T
getEndOfDay()
Deprecated.Computes first hour, minute, second, millisecond from the temporal instance.T
getEndOfMonth()
Deprecated.Compute the date of the first day in the month from the temporal instance.T
getEndOfWeek()
Deprecated.Compute the date of the first day in the week from the temporal instance.T
getEndOfWeek(String locale)
Deprecated.Compute the date of the first day in the week from the temporal instance and a given locale.T
getEndOfYear()
Deprecated.Compute the date of the first day in the year from the temporal instance.Duration
getTimeDataTo(T anotherDatable)
Deprecated.Compute the time between the temporal instance and another one.TimeZone
getTimeZone()
Deprecated.Gets the time zone for which this temporal is defined.T
inTimeZone(TimeZone timeZone)
Deprecated.Sets the time zone this temporal is defined for.boolean
isAfter(T anotherDatable)
Deprecated.Is this temporal strictly after in time the specified another one?boolean
isBefore(T anotherDatable)
Deprecated.Is this temporal strictly before in time the specified another one?boolean
isDefined()
Deprecated.Indicates is the date is different fromDateUtil.MINIMUM_DATE
orDateUtil.MAXIMUM_DATE
.boolean
isEqualTo(T anotherDatable)
Deprecated.Is this temporal equal in time to the specified another one?boolean
isNotDefined()
Deprecated.Indicates the opposite ofisDefined()
boolean
isTimeSupported()
Deprecated.Is this temporal supports the time unit?String
toICal()
Deprecated.Gets the ISO 8601 textual representation of this date as it is in the iCal specification.String
toICalInUTC()
Deprecated.Gets the ISO 8601 textual representation of this date as it is in the iCal specification.String
toISO8601()
Deprecated.Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone.String
toShortISO8601()
Deprecated.Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone.
-
-
-
Field Detail
-
SHORT_ISO_8601_PATTERN
static final String SHORT_ISO_8601_PATTERN
Deprecated.The pattern for the short ISO 8601 date representation. The date is at the accuracy to the minute and the time zone is specified as defined in the RFC 822 (indicated by the Z symbol).- See Also:
- Constant Field Values
-
ISO_8601_PATTERN
static final String ISO_8601_PATTERN
Deprecated.The pattern for the ISO 8601 date representation. The date is at the accuracy to the second and the time zone is specified as defined in the RFC 822 (indicated by the Z symbol).- See Also:
- Constant Field Values
-
ICAL_PATTERN
static final String ICAL_PATTERN
Deprecated.The pattern for the iCal date representation in the current time zone of the temporal.- See Also:
- Constant Field Values
-
ICAL_UTC_PATTERN
static final String ICAL_UTC_PATTERN
Deprecated.The pattern for the iCal date representation in UTC. The UTC set of the date is indicated here by the Z character.- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
T clone()
Deprecated.Clones itself.- Returns:
- a clone to this temporal.
-
asDate
Date asDate()
Deprecated.Gets the java Date representation of this temporal.- Returns:
- a Date representation of this temporal.
-
isBefore
boolean isBefore(T anotherDatable)
Deprecated.Is this temporal strictly before in time the specified another one?- Parameters:
anotherDatable
- the another temporal to which this is compared.- Returns:
- true if this temporal is strictly before the another one.
-
isAfter
boolean isAfter(T anotherDatable)
Deprecated.Is this temporal strictly after in time the specified another one?- Parameters:
anotherDatable
- the another temporal to which this is compared.- Returns:
- true if this temporal is strictly after the another one.
-
isEqualTo
boolean isEqualTo(T anotherDatable)
Deprecated.Is this temporal equal in time to the specified another one?- Parameters:
anotherDatable
- the another temporal to which this is compared.- Returns:
- true if this temporal is equal with the another one.
-
inTimeZone
T inTimeZone(TimeZone timeZone)
Deprecated.Sets the time zone this temporal is defined for. If no time zone is set, then the default one is considered (the timezone of the host). The time zone can have no meaning with some temporal types like for example simple date (day, month, and year).- Parameters:
timeZone
- the time zone of this temporal.- Returns:
- itself.
-
getTimeZone
TimeZone getTimeZone()
Deprecated.Gets the time zone for which this temporal is defined.- Returns:
- the time zone of this temporal.
-
isTimeSupported
boolean isTimeSupported()
Deprecated.Is this temporal supports the time unit?- Returns:
- true if this temporal supports the time unit. Time and datetime should return true here whereas date should return false.
-
toISO8601
String toISO8601()
Deprecated.Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone. For datetime, the representation is at the accuracy to the second. The ISO 8601 format in which the date is returned is one of the more common in the Web, that is with the datetime separators (the hyphen for dates and the double-points for times): yyyy-MM-dd'T'HH:mm:ss where yyyy means the year in 4 digits, MM means the month in year in two digits, dd means the day in month in two digits, HH means the hour (24-o'clock) in two digits, mm means the minute in two digits, and ss the second in two digits.- Returns:
- the ISO 8601 textual representation of this temporal.
-
toShortISO8601
String toShortISO8601()
Deprecated.Gets an ISO 8601 textual representation of this temporal by taking into account of its underlying timezone. For datetime, the representation is at the accuracy to the minute. The ISO 8601 format in which the date is returned is one of the more common in the Web, that is with the datetime separators (the hyphen for dates and the double-points for times): yyyy-MM-dd'T'HH:mm:ss where yyyy means the year in 4 digits, MM means the month in year in two digits, dd means the day in month in two digits, HH means the hour (24-o'clock) in two digits, and mm means the minute in two digits.- Returns:
- a short ISO 8601 textual representation of this temporal.
-
toICal
String toICal()
Deprecated.Gets the ISO 8601 textual representation of this date as it is in the iCal specification. The returned iCal date representation is in this temporal's time zone. In the iCal specification, dates are represented in one of the ISO 8601 format, that is the complete format without any datetime separators (the hyphen character for dates and the double-points for times). In the iCal specification, no time zone information is added to the ISO 8601 representation of the date, nevertheless when the date is indicated in UTC, the 'Z' marker must be set in the date as required by the ISO 8601 standard.- Returns:
- the iCal textual representation of this temporal and in the timezone of this temporal.
-
toICalInUTC
String toICalInUTC()
Deprecated.Gets the ISO 8601 textual representation of this date as it is in the iCal specification. The returned iCal date representation is in explicitly set in UTC. In the iCal specification, dates are represented in one of the ISO 8601 format, that is the complete format without any date and time separators (the hyphen character for dates and the double-points for times). In the iCal specification, no time zone information is added to the ISO 8601 representation of the date, nevertheless when the date is indicated in UTC, the 'Z' marker must be set in the date as required by the ISO 8601 standard.- Returns:
- the iCal textual representation of this temporal and in UTC.
-
getBeginOfDay
T getBeginOfDay()
Deprecated.Computes first hour, minute, second, millisecond from the temporal instance.- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getEndOfDay
T getEndOfDay()
Deprecated.Computes first hour, minute, second, millisecond from the temporal instance.- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getBeginOfWeek
T getBeginOfWeek()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getEndOfWeek
T getEndOfWeek()
Deprecated.Compute the date of the first day in the week from the temporal instance.- Returns:
- a date for the first day of the week of the temporal instance.
-
getBeginOfWeek
T getBeginOfWeek(String locale)
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance and a given locale.- Parameters:
locale
- the locale- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getEndOfWeek
T getEndOfWeek(String locale)
Deprecated.Compute the date of the first day in the week from the temporal instance and a given locale.- Parameters:
locale
- the locale- Returns:
- a date for the first day of the week of the temporal instance.
-
getBeginOfMonth
T getBeginOfMonth()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getEndOfMonth
T getEndOfMonth()
Deprecated.Compute the date of the first day in the month from the temporal instance.- Returns:
- a date for the first day of the month of the temporal instance.
-
getBeginOfYear
T getBeginOfYear()
Deprecated.Compute the first hour, minute, second, millisecond from the temporal instance.- Returns:
- a date at last hour, minute, second and millisecond of the temporal instance.
-
getEndOfYear
T getEndOfYear()
Deprecated.Compute the date of the first day in the year from the temporal instance.- Returns:
- a date for the first day of the year of the temporal instance.
-
getTimeDataTo
Duration getTimeDataTo(T anotherDatable)
Deprecated.Compute the time between the temporal instance and another one.- Parameters:
anotherDatable
- another date- Returns:
- the time between the temporal instance and another one represented by
Duration
.
-
addYears
T addYears(int amount)
Deprecated.Adds a number of years to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addMonths
T addMonths(int amount)
Deprecated.Adds a number of months to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addWeeks
T addWeeks(int amount)
Deprecated.Adds a number of weeks to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addDays
T addDays(int amount)
Deprecated.Adds a number of days to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addHours
T addHours(int amount)
Deprecated.Adds a number of hours to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addMinutes
T addMinutes(int amount)
Deprecated.Adds a number of minutes to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addSeconds
T addSeconds(int amount)
Deprecated.Adds a number of seconds to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
addMilliseconds
T addMilliseconds(int amount)
Deprecated.Adds a number of milliseconds to the temporal instance returning a new one. The originalTemporal
is unchanged.- Parameters:
amount
- the amount to add, may be negative- Returns:
- the new
Temporal
with the amount added
-
isDefined
boolean isDefined()
Deprecated.Indicates is the date is different fromDateUtil.MINIMUM_DATE
orDateUtil.MAXIMUM_DATE
.- Returns:
- true if the date is not equal to undefined one, false otherwise.
-
isNotDefined
boolean isNotDefined()
Deprecated.Indicates the opposite ofisDefined()
- Returns:
- true if the date is undefined, false otherwise.
-
-