Class ModifiedJulianDayDateTime
java.lang.Object
net.okapia.osid.primordium.calendaring.datetime.spi.AbstractDateTime
net.okapia.osid.primordium.calendaring.datetime.spi.AbstractConfigurableDateTime
net.okapia.osid.primordium.calendaring.datetime.spi.AbstractDayCountDateTime
net.okapia.osid.primordium.calendaring.datetime.counting.ModifiedJulianDayDateTime
- All Implemented Interfaces:
Serializable, Comparable<DateTime>, DateTime, OsidPrimitive, DateTime, OsidPrimitive
A Modified Julian Day: a count of days from midnight on 1858-11-17. A
day count with no time of day; it renders as the bare count.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe factory forModifiedJulianDayDateTimes.static classThe specifier forModifiedJulianDayDateTimes. -
Field Summary
FieldsFields inherited from class AbstractConfigurableDateTime
GREGORIAN_REFORM, YEARS_PER_BLUEMOONModifier and TypeFieldDescriptionprotected static final Instantthe gregorian reformstatic final BigDecimalthe years per bluemoon -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newModifiedJulianDayDateTime. -
Method Summary
Methods inherited from class AbstractDayCountDateTime
atCount, currentCount, getCount, toStringModifier and TypeMethodDescriptionprotected static AbstractConfigurableDateTimeSpecifieratCount(AbstractConfigurableDateTimeSpecifier specifier, long count) Populates a specifier at a count: a year and month of zero and the count in the day, giving day resolution.protected static longcurrentCount(CalendarInfo calendar) Gets the count for today (UTC) in the given day-count calendar, by way of the shared day-number timeline.longgetCount()Gets the count of days carried by this date.toString()Renders the bare count.Methods inherited from class AbstractConfigurableDateTime
compare, compareTo, denormalize, equals, formatDigits, formatNumber, formatYear, fromComponents, fromInstant, fromLocalDateTime, fromOffsetDateTime, fromZonedDateTime, getDateTimeFactory, getTime, getWeek, hashCode, isExclusive, isGreater, isInclusive, isLess, minus, minus, parse, parseISO, plus, plus, requireResolution, toLocaleDateString, toLocaleTimeString, toShortLocaleDateString, toTime, toTimeStringModifier and TypeMethodDescriptionprotected static intcompare(DateTime dt1, DateTime dt2, DateTimeFactory factory) Compares two normalized finite datetimes.intCompares this DateTime with the specified DateTime for ordering.final DateTimeIntervalReturns an interval based on this DateTime derived by its granularity and uncertainty.final booleanDetermines if the givenTimeis equal to this one.protected static StringformatDigits(long num, int n) Formats a number, zero-padded to a minimum number of digits.protected static StringformatNumber(long num) Formats a number as an ordinal (1st, 2nd, 3rd, ...).protected static StringformatYear(long year) Formats a year for display, zero-padded to four digits within the common range.protected static DateTimefromComponents(DateTimeFactory factory, long year, long month, long day, Time time) Builds a DateTime from explicit calendar components.protected static DateTimefromInstant(DateTimeFactory factory, Instant instant, DateTimeResolution granularity) Converts a JavaInstantto a DateTime.protected static DateTimefromLocalDateTime(DateTimeFactory factory, LocalDateTime ldt, DateTimeResolution granularity) Converts a JavaLocalDateTimeto a DateTime, treating the value as already in UTC.protected static DateTimefromOffsetDateTime(DateTimeFactory factory, OffsetDateTime odt, DateTimeResolution granularity) Converts a JavaOffsetDateTimeto a DateTime, adjusting to UTC.protected static DateTimefromZonedDateTime(DateTimeFactory factory, ZonedDateTime zdt, DateTimeResolution granularity) Converts a JavaZonedDateTimeto a DateTime, adjusting to UTC.protected DateTimeFactoryGets the datetime factory.protected TimegetTime()Gets the time component.final longgetWeek()Gets the week of the year, counting from one.final inthashCode()Returns a hash code value for thisTimebased on the type, granularity and values.final booleanisExclusive(DateTime datetime) Tests if the range of this DateTime, as specified by its granularity and uncertainty, does not overlap with the given DateTime.booleanTests if this DateTime is greater than the given DateTime.final booleanisInclusive(DateTime datetime) Tests if the range of this DateTime, as specified by its granularity and uncertainty, includes the given DateTime ranged by its grabularity and uncertainty.final booleanTests if this DateTime is less than the given DateTime.minus(long amount, DateTimeResolution unit) Subtracts a number of a resolution's units from this datetime.Subtracts a duration from this datetime.protected static DateTimeparse(DateTimeFactory factory, String string) Parses the okapia-extended datetime form: a strict ISO datetime optionally trailed by an uncertainty (" ±n unit" / " +p -m unit", with an optional "exclusive"), or the standalone "?" (unknown) and "infinity".protected static DateTimeparseISO(DateTimeFactory factory, String iso) Parses an ISO date string.plus(long amount, DateTimeResolution unit) Adds a number of a resolution's units to this datetime, in its own calendar.Adds a duration to this datetime, applying its calendar components (years, months, weeks, days) and clock components (hours, minutes, seconds) in this datetime's own calendar.protected static voidrequireResolution(DateTimeResolution granularity, DateTimeResolution floor, String source) Verifies that a requested resolution is no finer than the source's own precision, so a conversion does not fabricate digits the source cannot supply -- e.g.Renders the date in a long locale form using the calendar's own month names -- the Gregorian form, for example, is "January 31, 2020", and at month granularity "January 2020".Renders the time in a locale form.Renders the date in a short locale form, abbreviating the month name -- the Gregorian form is "31 Jan 2020", and at month granularity "Jan 2020".toTime()Gets the time of day as aTime.Renders the time of day, or the empty string when this datetime has no time component (a granularity of a day or coarser).Methods inherited from class AbstractDateTime
coarsePeriodYears, definesUncertainty, getAeon, getAttoseconds, getCalendarType, getCentury, getDay, getEpoch, getFemtoseconds, getGranularity, getGranularityMultiplier, getHour, getMicroquectoseconds, getMicroseconds, getMillennium, getMilliquectoseconds, getMilliseconds, getMinute, getMonth, getNanoseconds, getPicoseconds, getPlanckseconds, getQuectoseconds, getRontoseconds, getSecond, getTimeType, getUncertaintyMinus, getUncertaintyPlus, getUncertaintyUnits, getYear, getYoctoseconds, getZeptoseconds, isUncertaintyDateInclusive, rawDay, referenceYearModifier and TypeMethodDescriptionprotected long[]Gets the first and last year of this value's coarse period.final booleanTests if uncertainty is defined for this time.final longgetAeon()Gets the aeon.final longGets the number of attoseconds of the femtoseconds 0-999.final TypeGets the calendar type.final longGets the century.final longgetDay()Gets the day of the month.final longgetEpoch()Gets the epoch.final longGets the number of femtoseconds of the picosecond 0-999.final DateTimeResolutionGets the granularity of this time.final longIf the granularity of the time equalsgetGranularity(),then the multiplier is 1.final longgetHour()Gets the hour of the day.final longGets the number of undaseconds of the vatosecond 0-999.final longGets the number of microseconds of the second 0-999.final longGets the millennium.final longGets the number of vatoseconds of the xoxxosecond 0-999.final longGets the number of milliseconds in this second 0-999.final longGets the minute of the hour.final longgetMonth()Gets the month.final longGets the number of nanoseconds of the microsecond 0-999.final longGets the number of picoseconds of the nanosecond 0-999.final longGets the number of Plancks of the vatoseconds.final longGets the number of weebleseconds of the xoxxosecond 0-999.final longGets the number of xoxxoseconds of the yoctosecond 0-999.final longGets the second of the minute.final TypeGets the time type.final longGets the uncertainty of this time in the negative direction.final longGets the uncertainty of this time in the positive direction.final DateTimeResolutionGets the units of the uncertainty.final longgetYear()Gets the year.final longGets the number of yoctoseconds of the picosecond 0-999.final longGets the number of zeptoseconds of the attosecond 0-999.booleanTests if the uncertainty is inclusive of all dates.protected final longrawDay()Gets the stored day of the month, ungated by granularity.protected longGets a year within this value's period, from which the coarser fields are derived.
-
Field Details
-
CALENDAR_TYPE
the OSID Type
-
-
Constructor Details
-
ModifiedJulianDayDateTime
public ModifiedJulianDayDateTime(ModifiedJulianDayDateTime.ModifiedJulianDayDateTimeSpecifier specifier) Constructs a newModifiedJulianDayDateTime.- Parameters:
specifier- a datetime specifier- Throws:
NullArgumentException-specifierisnull
-
-
Method Details
-
valueOf
Creates a Modified Julian Day from a count.- Parameters:
count- the day count- Returns:
- a Modified Julian Day datetime
-
datetime
Creates a Modified Julian Day from a count. Equivalent tovalueOf(long).- Parameters:
count- the day count- Returns:
- a Modified Julian Day datetime
-
now
Gets the Modified Julian Day for today (UTC).- Returns:
- today's Modified Julian Day
-