public class DefaultTimeSupportManager extends Object implements TimeSupportManager
TimeSupportManager
implementation.Constructor and Description |
---|
DefaultTimeSupportManager() |
Modifier and Type | Method and Description |
---|---|
void |
addRelativeInstantPattern(String relativeInstantPattern)
Add a time pattern that is used to parse a relative instant
|
AbsoluteInstant |
createAbsoluteInstant()
Creates an
AbsoluteInstant without any value. |
AbsoluteInstant |
createAbsoluteInstant(Chronology chronology)
Creates an
AbsoluteInstant without any value and
using a chronology. |
AbsoluteInstant |
createAbsoluteInstant(int[] types,
int[] values)
Creates an
AbsoluteInstant with a set of types and an array of
values. |
AbsoluteInstant |
createAbsoluteInstant(int[] types,
int[] values,
Chronology chronology)
Creates an
AbsoluteInstant with a set of types and an array of
values. |
AbsoluteInstant |
createAbsoluteInstant(int type,
int value)
Creates an
AbsoluteInstant with a type and a value. |
AbsoluteInstant |
createAbsoluteInstant(int type,
int value,
Chronology chronology)
Creates an
AbsoluteInstant with a type and a value and
using a chronology. |
AbsoluteInterval |
createAbsoluteInterval(AbsoluteInstant startPartial,
AbsoluteInstant endPartial)
Creates an
AbsoluteInterval from a start and an end
instants. |
AbsoluteInterval |
createAbsoluteInterval(AbsoluteInstant startInstant,
AbsoluteInstant endInstant,
Chronology chronology)
Creates an
AbsoluteInterval from a start and an end
instants and a chronology. |
AbsoluteInterval |
createAbsoluteInterval(AbsoluteInstant startPartial,
int years,
int months,
int weeks,
int days,
int hours,
int minutes,
int seconds,
int millis)
Creates an
AbsoluteInterval from a start instant and an increment
of the time fields. |
AbsoluteInterval |
createAbsoluteInterval(AbsoluteInstant startPartial,
int years,
int months,
int weeks,
int days,
int hours,
int minutes,
int seconds,
int millis,
Chronology chronology)
Creates an
AbsoluteInterval from a start instant and an increment
of the time fields and a chronology. |
AbsoluteInterval |
createAbsoluteInterval(int years,
int months,
int weeks,
int days,
int hours,
int minutes,
int seconds,
int millis)
Creates an
AbsoluteInterval from individual
fields. |
AbsoluteInterval |
createAbsoluteInterval(int years,
int months,
int weeks,
int days,
int hours,
int minutes,
int seconds,
int millis,
Chronology chronology)
Creates an
AbsoluteInterval from individual
fields and a chronology. |
AbsoluteInterval |
createAbsoluteInterval(RelativeInstant startPartial,
RelativeInstant endPartial) |
RelativeInstant |
createRelativeInstant(Chronology chronology)
Creates a
RelativeInstant using the current system time
and using a chronology. |
RelativeInstant |
createRelativeInstant(Date date)
Creates a
RelativeInstant using a Date . |
RelativeInstant |
createRelativeInstant(Date date,
Chronology chronology)
Creates a
RelativeInstant using a Date
and using a chronology. |
RelativeInstant |
createRelativeInstant(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
Creates a
RelativeInstant using the datetime field values. |
RelativeInstant |
createRelativeInstant(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond,
Chronology chronology)
Creates a
RelativeInstant using the datetime field values
and using a chronology. |
RelativeInstant |
createRelativeInstant(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond,
int chronology)
Creates a
RelativeInstant using the datetime field values
and using a chronology code. |
RelativeInstant |
createRelativeInstant(long instant)
Creates a
RelativeInstant using the number of milliseconds from
1970-01-01T00:00Z. |
RelativeInstant |
createRelativeInstant(long instant,
Chronology chronology)
Creates a
RelativeInstant using the number of milliseconds from
1970-01-01T00:00Z and using a chronology. |
RelativeInterval |
createRelativeInterval(long startInstant,
long endInstant)
Creates a
RelativeInterval from a start and an end
instants. |
RelativeInterval |
createRelativeInterval(long startInstant,
long endInstant,
Chronology chronology)
Creates a
RelativeInterval from a start and an end
instants, and using a chonology. |
RelativeInterval |
createRelativeInterval(RelativeInstant startDateTime,
RelativeInstant endDateTime)
Creates a
RelativeInterval from a start and an end
instants. |
RelativeInterval |
createRelativeInterval(RelativeInstant startDateTime,
RelativeInstant endDateTime,
Chronology chronology) |
TimeAnimation |
createTimeAnimation()
Creates a time animation object.
|
AbsoluteInstantType |
getAbsoluteInstantType(int type)
Gets an
AbsoluteInstantType by code. |
AbsoluteIntervalType |
getAbsoluteIntervalType(int type)
Gets an
AbsoluteIntervalType by code. |
Chronology |
getChronology(int chronology)
Gets an
Chronology by code. |
RelativeInstant |
parseRelativeInstant(String relativeInstantString)
Creates a relative instant from a string.
|
void |
registerAbsoluteInstantType(AbsoluteInstantType absoluteInstantType)
Registers a new
AbsoluteInstantType that can be used in the
creation of an AbsoluteInstant . |
void |
registerAbsoluteIntervalType(AbsoluteIntervalType absoluteIntervalType)
Registers a new
AbsoluteIntervalType that can be used in the
creation of an AbsoluteInterval . |
void |
registerChronology(Chronology chronology)
Registers a new
Chronology that can be used in the
creation of any temporal object. |
void |
setDefaultChronology(int chronology)
Sets the default chronology.
|
public void registerAbsoluteInstantType(AbsoluteInstantType absoluteInstantType)
TimeSupportManager
AbsoluteInstantType
that can be used in the
creation of an AbsoluteInstant
.registerAbsoluteInstantType
in interface TimeSupportManager
absoluteInstantType
- the AbsoluteInstantType to registerpublic AbsoluteInstantType getAbsoluteInstantType(int type) throws AbsoluteInstantTypeNotRegisteredException
TimeSupportManager
AbsoluteInstantType
by code.getAbsoluteInstantType
in interface TimeSupportManager
type
- the code of the AbsoluteInstantType
to retrieve.AbsoluteInstantType
with a concrete code.AbsoluteInstantTypeNotRegisteredException
- if the AbsoluteInstantType
doen's exist.public void registerAbsoluteIntervalType(AbsoluteIntervalType absoluteIntervalType)
TimeSupportManager
AbsoluteIntervalType
that can be used in the
creation of an AbsoluteInterval
.registerAbsoluteIntervalType
in interface TimeSupportManager
public AbsoluteIntervalType getAbsoluteIntervalType(int type) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteIntervalType
by code.getAbsoluteIntervalType
in interface TimeSupportManager
type
- the code of the AbsoluteIntervalType
to retrieve.AbsoluteIntervalType
with a concrete code.AbsoluteIntervalTypeNotRegisteredException
- if the AbsoluteIntervalType
doen's exist.public void registerChronology(Chronology chronology)
TimeSupportManager
Chronology
that can be used in the
creation of any temporal object.registerChronology
in interface TimeSupportManager
chronology
- the chronology to registerpublic Chronology getChronology(int chronology)
TimeSupportManager
Chronology
by code.getChronology
in interface TimeSupportManager
Chronology
with a concrete code.public void setDefaultChronology(int chronology)
TimeSupportManager
setDefaultChronology
in interface TimeSupportManager
chronology
- the default chronology.public RelativeInstant createRelativeInstant(long instant)
TimeSupportManager
RelativeInstant
using the number of milliseconds from
1970-01-01T00:00Z. It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createRelativeInstant
in interface TimeSupportManager
instant
- the milliseconds from 1970-01-01T00:00:00Zpublic RelativeInstant createRelativeInstant(Date date)
TimeSupportManager
RelativeInstant
using a Date
.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createRelativeInstant
in interface TimeSupportManager
date
- the java.util.Datepublic AbsoluteInstant createAbsoluteInstant()
TimeSupportManager
AbsoluteInstant
without any value.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInstant
in interface TimeSupportManager
public RelativeInstant createRelativeInstant(long instant, Chronology chronology)
TimeSupportManager
RelativeInstant
using the number of milliseconds from
1970-01-01T00:00Z and using a chronology.createRelativeInstant
in interface TimeSupportManager
instant
- the milliseconds from 1970-01-01T00:00:00Z.chronology
- the chronology.public RelativeInstant createRelativeInstant(Date date, Chronology chronology)
TimeSupportManager
RelativeInstant
using a Date
and using a chronology.createRelativeInstant
in interface TimeSupportManager
date
- the java.util.Datechronology
- the chronology.public RelativeInstant createRelativeInstant(Chronology chronology)
TimeSupportManager
RelativeInstant
using the current system time
and using a chronology.createRelativeInstant
in interface TimeSupportManager
chronology
- the chronology.public RelativeInstant createRelativeInstant(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
TimeSupportManager
RelativeInstant
using the datetime field values.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createRelativeInstant
in interface TimeSupportManager
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondpublic RelativeInstant createRelativeInstant(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Chronology chronology)
TimeSupportManager
RelativeInstant
using the datetime field values
and using a chronology.createRelativeInstant
in interface TimeSupportManager
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondchronology
- the chronology.public RelativeInstant createRelativeInstant(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, int chronology)
TimeSupportManager
RelativeInstant
using the datetime field values
and using a chronology code.createRelativeInstant
in interface TimeSupportManager
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondchronology
- the chronology code.public AbsoluteInstant createAbsoluteInstant(int type, int value) throws AbsoluteInstantTypeNotRegisteredException
TimeSupportManager
AbsoluteInstant
with a type and a value.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInstant
in interface TimeSupportManager
type
- the single type to create the instant. It has to be
one of the values specified in AbsoluteInstantType
.value
- the value of the field.AbsoluteInstantTypeNotRegisteredException
- if there is not an AbsoluteInstantType
with
this code.public AbsoluteInstant createAbsoluteInstant(int[] types, int[] values) throws AbsoluteInstantTypeNotRegisteredException
TimeSupportManager
AbsoluteInstant
with a set of types and an array of
values. The length of both arrays has to be the same.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInstant
in interface TimeSupportManager
types
- the types to create the instant. All of them have to be
one of the values specified in AbsoluteInstantType
.values
- the values of every field.AbsoluteInstantTypeNotRegisteredException
- if there is not an AbsoluteInstantType
with
the codes.public AbsoluteInstant createAbsoluteInstant(int type, int value, Chronology chronology) throws AbsoluteInstantTypeNotRegisteredException
TimeSupportManager
AbsoluteInstant
with a type and a value and
using a chronology.createAbsoluteInstant
in interface TimeSupportManager
type
- the single type to create the instant. It has to be
one of the values specified in AbsoluteInstantType
.value
- the value of the field.chronology
- the chronology.AbsoluteInstantTypeNotRegisteredException
- if there is not an AbsoluteInstantType
with
this code.public AbsoluteInstant createAbsoluteInstant(int[] types, int[] values, Chronology chronology) throws AbsoluteInstantTypeNotRegisteredException
TimeSupportManager
AbsoluteInstant
with a set of types and an array of
values. It uses a chronology. and the length of both arrays has to be the same.createAbsoluteInstant
in interface TimeSupportManager
values
- the values of every field.chronology
- the chronology.AbsoluteInstantTypeNotRegisteredException
- if there is not an AbsoluteInstantType
with
the codes.public AbsoluteInstant createAbsoluteInstant(Chronology chronology)
TimeSupportManager
AbsoluteInstant
without any value and
using a chronology.createAbsoluteInstant
in interface TimeSupportManager
chronology
- the chronology.public RelativeInterval createRelativeInterval(long startInstant, long endInstant)
TimeSupportManager
RelativeInterval
from a start and an end
instants. It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createRelativeInterval
in interface TimeSupportManager
startInstant
- start of this interval, as milliseconds from 1970-01-01T00:00:00Z.endInstant
- end of this interval, as milliseconds from 1970-01-01T00:00:00Z.public RelativeInterval createRelativeInterval(RelativeInstant startDateTime, RelativeInstant endDateTime)
TimeSupportManager
RelativeInterval
from a start and an end
instants. It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createRelativeInterval
in interface TimeSupportManager
public RelativeInterval createRelativeInterval(long startInstant, long endInstant, Chronology chronology)
TimeSupportManager
RelativeInterval
from a start and an end
instants, and using a chonology.createRelativeInterval
in interface TimeSupportManager
startInstant
- start of this interval, as milliseconds from 1970-01-01T00:00:00Z.endInstant
- end of this interval, as milliseconds from 1970-01-01T00:00:00Z.chronology
- the chronology.public RelativeInterval createRelativeInterval(RelativeInstant startDateTime, RelativeInstant endDateTime, Chronology chronology)
public AbsoluteInterval createAbsoluteInterval(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteInterval
from individual
fields. The start interval is the time 0.
It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInterval
in interface TimeSupportManager
years
- the years of the end instant.months
- the months of the end instant.weeks
- the weeks of the end instant.days
- the days of the end instant.hours
- the hours of the end instant.minutes
- the minutes of the end instant.seconds
- the seconds of the end instant.millis
- the milliseconds of the end instant.AbsoluteIntervalTypeNotRegisteredException
- if there is not
the necessary AbsoluteIntervalType
.public AbsoluteInterval createAbsoluteInterval(AbsoluteInstant startPartial, int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteInterval
from a start instant and an increment
of the time fields. It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInterval
in interface TimeSupportManager
startPartial
- start of this intervalyears
- the years to increment the instant.months
- the months to increment the instant.weeks
- the weeks to increment the instant.days
- the days to increment the instant.hours
- the hours to increment the instant.minutes
- the minutes to increment the instant.seconds
- the seconds to increment the instant.millis
- the milliseconds to increment the instant.AbsoluteIntervalTypeNotRegisteredException
- if there is not
the necessary AbsoluteIntervalType
.public AbsoluteInterval createAbsoluteInterval(int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis, Chronology chronology) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteInterval
from individual
fields and a chronology. The start interval is the time 0.createAbsoluteInterval
in interface TimeSupportManager
years
- the years of the end instant.months
- the months of the end instant.weeks
- the weeks of the end instant.days
- the days of the end instant.hours
- the hours of the end instant.minutes
- the minutes of the end instant.seconds
- the seconds of the end instant.millis
- the milliseconds of the end instant.chronology
- the chronologyAbsoluteIntervalTypeNotRegisteredException
- if there is not
the necessary AbsoluteIntervalType
.public AbsoluteInterval createAbsoluteInterval(AbsoluteInstant startPartial, int years, int months, int weeks, int days, int hours, int minutes, int seconds, int millis, Chronology chronology) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteInterval
from a start instant and an increment
of the time fields and a chronology. The seconds instant is defined by
all the individual fields.createAbsoluteInterval
in interface TimeSupportManager
startPartial
- start of this intervalyears
- the years to increment the instant.months
- the months to increment the instant.weeks
- the weeks to increment the instant.days
- the days to increment the instant.hours
- the hours to increment the instant.minutes
- the minutes to increment the instant.seconds
- the seconds to increment the instant.millis
- the milliseconds to increment the instant.chronology
- the chronologyAbsoluteIntervalTypeNotRegisteredException
- if there is not
the necessary AbsoluteIntervalType
.public AbsoluteInterval createAbsoluteInterval(AbsoluteInstant startPartial, AbsoluteInstant endPartial)
TimeSupportManager
AbsoluteInterval
from a start and an end
instants. It uses the chronology defined by the
TimeSupportManager.setDefaultChronology(int)
method.createAbsoluteInterval
in interface TimeSupportManager
startPartial
- start of this interval, null means nowendPartial
- end of this interval, null means nowpublic AbsoluteInterval createAbsoluteInterval(RelativeInstant startPartial, RelativeInstant endPartial)
public AbsoluteInterval createAbsoluteInterval(AbsoluteInstant startInstant, AbsoluteInstant endInstant, Chronology chronology) throws AbsoluteIntervalTypeNotRegisteredException
TimeSupportManager
AbsoluteInterval
from a start and an end
instants and a chronology.createAbsoluteInterval
in interface TimeSupportManager
startInstant
- start of this intervalendInstant
- end of this intervalchronology
- the chronology.AbsoluteIntervalTypeNotRegisteredException
- if there is not
the necessary AbsoluteIntervalType
.public void addRelativeInstantPattern(String relativeInstantPattern)
TimeSupportManager
addRelativeInstantPattern
in interface TimeSupportManager
relativeInstantPattern
- the pattern tor parse the instantpublic RelativeInstant parseRelativeInstant(String relativeInstantString)
TimeSupportManager
TimeSupportManager.addRelativeInstantPattern(String)
method.parseRelativeInstant
in interface TimeSupportManager
relativeInstantString
- the relative instant like a stringnull
.public TimeAnimation createTimeAnimation()
TimeSupportManager
createTimeAnimation
in interface TimeSupportManager