Record Class NaftahDateTime
- Record Components:
naftahDate- the date componentnaftahTime- the time componenttemporal- the resolved temporal
- All Implemented Interfaces:
DateSupport,NaftahTemporal,NaftahTemporalPoint,TimeSupport
- An
NaftahDatecomponent - An
NaftahTimecomponent - A resolved
Temporalrepresentation
This record is typically produced after parsing Arabic date and time expressions and resolving them against a specific chronology or calendar system.
The Temporal allows integration with Java's time API.
- Author:
- Chakib Daii
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NaftahDateThe field for thenaftahDaterecord component.private final NaftahTimeThe field for thenaftahTimerecord component.private final TemporalThe field for thetemporalrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNaftahDateTime(NaftahDate naftahDate, NaftahTime naftahTime, Temporal temporal) Creates an instance of aNaftahDateTimerecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate NaftahDateTimecompute(NaftahTemporalAmount arabicTemporalAmount, boolean plus) Computes a newArabicDateTimeby applying the given Arabic temporal amount using either addition or subtraction.final booleanIndicates whether some other object is "equal to" this one.intReturns the day-of-month of the date part of thisArabicDateTime.Returns the day of the week of the date part of thisArabicDateTimeas an Arabic string.intReturns the day-of-year of the date part of thisArabicDateTime, according to its chronology.intgetHour()Gets the hour-of-day from the time part of thisArabicDateTime.intGets the minute-of-hour from the time part of thisArabicDateTime.getMonth()Returns the Arabic month name of the date part of thisArabicDateTime.intReturns the numeric month value (1–12) of the date part of thisArabicDateTime.intgetNano()Gets the nano-of-second from the time part of thisArabicDateTime.intGets the second-of-minute from the time part of thisArabicDateTime.intgetYear()Returns the year of the date part of thisArabicDateTime.final inthashCode()Returns a hash code value for this object.booleanChecks whether the year of the date part of thisArabicDateTimeis a leap year in its chronology.intReturns the length of the month in days for the date part of thisArabicDateTime.intReturns the length of the year in days for the date part of thisArabicDateTime.minus(NaftahTemporalAmount naftahTemporalAmount) Returns a newArabicDateTimeobtained by subtracting the given Arabic temporal amount from this date-time.minusDays(long daysToSubtract) Returns a newArabicDateTimewith the specified number of days subtracted.minusHours(long hoursToSubtract) Returns a newArabicDateTimewith the specified number of hours subtracted.minusMinutes(long minutesToSubtract) Returns a newArabicDateTimewith the specified number of minutes subtracted.minusMonths(long monthsToSubtract) Returns a newArabicDateTimewith the specified number of months subtracted.minusNanos(long nanosToSubtract) Returns a newArabicDateTimewith the specified number of nanoseconds subtracted.minusSeconds(long secondsToSubtract) Returns a newArabicDateTimewith the specified number of seconds subtracted.minusWeeks(long weeksToSubtract) Returns a newArabicDateTimewith the specified number of weeks subtracted.minusYears(long yearsToSubtract) Returns a newArabicDateTimewith the specified number of years subtracted.Returns the value of thenaftahDaterecord component.Returns the value of thenaftahTimerecord component.static NaftahDateTimenow()Obtains the current date-time using the default chronology and the system default time zone.static NaftahDateTimenow(Chronology chronology) Obtains the current date-time using the specified chronology and the system default time zone.static NaftahDateTimenow(Chronology chronology, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains the current date-time using the specified chronology and zone or offset.static NaftahDateTimenow(NaftahDate.Calendar calendar) Obtains the current date-time using the specified calendar and the system default time zone.static NaftahDateTimenow(NaftahDate.Calendar calendar, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains the current date-time using the specified calendar and zone or offset.static NaftahDateTimenow(NaftahTime.ZoneOrOffset zoneOrOffset) Obtains the current date-time using the default chronology and the specified zone or offset.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute) Obtains an instance ofArabicDateTimefrom year, month, day, hour, and minute.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, and second.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, second, and nanosecond.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, and second, using an optional time zone or offset.static NaftahDateTimeof(int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, and minute, using an optional time zone or offset.static NaftahDateTimeObtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, and minute.static NaftahDateTimeObtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, and second.static NaftahDateTimeObtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, second, and nanosecond.static NaftahDateTimeof(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.static NaftahDateTimeof(int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.static NaftahDateTimeof(int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, and minute, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, and minute.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, and second.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, second, and nanosecond.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, and second, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, and minute, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, and minute.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, and second.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, second, and nanosecond.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.static NaftahDateTimeof(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, and minute, using an optional time zone or offset.static NaftahDateTimeof(NaftahDate naftahDate, NaftahTime arabicTime) Creates a newArabicDateTimeinstance.static NaftahDateTimeof(NaftahDate naftahDate, NaftahTime arabicTime, Temporal temporal) Creates a newArabicDateTimeinstance.plus(NaftahTemporalAmount naftahTemporalAmount) Returns a newArabicDateTimeobtained by adding the given Arabic temporal amount to this date-time.plusDays(long daysToAdd) Returns a newArabicDateTimewith the specified number of days added.plusHours(long hoursToAdd) Returns a newArabicDateTimewith the specified number of hours added.plusMinutes(long minutesToAdd) Returns a newArabicDateTimewith the specified number of minutes added.plusMonths(long monthsToAdd) Returns a newArabicDateTimewith the specified number of months added.plusNanos(long nanosToAdd) Returns a newArabicDateTimewith the specified number of nanoseconds added.plusSeconds(long secondsToAdd) Returns a newArabicDateTimewith the specified number of seconds added.plusWeeks(long weeksToAdd) Returns a newArabicDateTimewith the specified number of weeks added.plusYears(long yearsToAdd) Returns a newArabicDateTimewith the specified number of years added.temporal()Returns the value of thetemporalrecord component.longReturns the number of days since the epoch (1970-01-01 ISO) for the date part of thisArabicDateTime.toString()Returns a string representation of thisArabicDateTimein the format: "date time".Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.daiitech.naftah.builtin.time.NaftahTemporalPoint
greaterThan, greaterThanEquals, isEquals, lessThan, lessThanEquals, notEqualsMethods inherited from interface org.daiitech.naftah.builtin.time.TimeSupport
getMilli
-
Field Details
-
naftahDate
The field for thenaftahDaterecord component. -
naftahTime
The field for thenaftahTimerecord component. -
temporal
The field for thetemporalrecord component.
-
-
Constructor Details
-
NaftahDateTime
Creates an instance of aNaftahDateTimerecord class.- Parameters:
naftahDate- the value for thenaftahDaterecord componentnaftahTime- the value for thenaftahTimerecord componenttemporal- the value for thetemporalrecord component
-
-
Method Details
-
now
Obtains the current date-time using the default chronology and the system default time zone.- Returns:
- the current
ArabicDateTime
-
now
Obtains the current date-time using the specified chronology and the system default time zone.- Parameters:
chronology- the chronology to use (notnull)- Returns:
- the current
ArabicDateTime - Throws:
NullPointerException- ifchronologyisnull
-
now
Obtains the current date-time using the specified calendar and the system default time zone.- Parameters:
calendar- the calendar to use (notnull)- Returns:
- the current
ArabicDateTime - Throws:
NullPointerException- ifcalendarisnull
-
now
Obtains the current date-time using the default chronology and the specified zone or offset.- Parameters:
zoneOrOffset- the zone or offset to use, ornullto use the system default- Returns:
- the current
ArabicDateTime
-
now
Obtains the current date-time using the specified chronology and zone or offset.- Parameters:
chronology- the chronology to use (notnull)zoneOrOffset- the zone or offset to use, ornullto use the system default- Returns:
- the current
ArabicDateTime - Throws:
NullPointerException- ifchronologyisnull
-
now
public static NaftahDateTime now(NaftahDate.Calendar calendar, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains the current date-time using the specified calendar and zone or offset.The returned
ArabicDateTimerepresents the current date and time as resolved by the given calendar and zone or offset.- Parameters:
calendar- the calendar to use (notnull)zoneOrOffset- the zone or offset to use, ornullto use the system default- Returns:
- the current
ArabicDateTime - Throws:
NullPointerException- ifcalendarisnull
-
of
Obtains an instance ofArabicDateTimefrom year, month, day, hour, and minute.The second and nanosecond fields will default to
0. The day must be valid for the specified month and year.- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, and minute, using an optional time zone or offset.The second and nanosecond fields will default to
0. The day must be valid for the specified month and year.If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, and second.The nanosecond field will default to
0. The day must be valid for the specified month and year.- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, and second, using an optional time zone or offset.The nanosecond field will default to
0. The day must be valid for the specified month and year.If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, second, and nanosecond.The day must be valid for the specified month and year.
- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.The day must be valid for the specified month and year.
If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, and minute.The second and nanosecond fields will default to
0.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, and minute, using an optional time zone or offset.The second and nanosecond fields will default to
0. The day must be valid for the specified month and year according to the provided chronology.If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, and second.The nanosecond field will default to
0.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, and second, using an optional time zone or offset.The nanosecond field will default to
0. The day must be valid for the specified month and year according to the provided chronology.If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, second, and nanosecond.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.The day must be valid for the specified month and year according to the provided chronology.
If a
zoneOrOffsetis provided, the resulting date-time will be backed by aOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuemonth- the month-of-year value (1–12)dayOfMonth- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, and minute.Seconds and nanoseconds default to
0.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month value (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, and minute, using an optional time zone or offset.The second and nanosecond fields default to
0. The day must be valid for the specified month and year.If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, and second.Nanoseconds default to
0. The day must be valid for the specified month and year.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.The nanosecond field defaults to
0. The day must be valid for the specified month and year.If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, second, and nanosecond.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.The day must be valid for the specified month and year.
If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
year- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nanosecond-of-second (0–999,999,999)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, and minute.Seconds and nanoseconds default to
0.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, and minute, using an optional time zone or offset.Seconds and nanoseconds default to
0.If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, and second.Nanoseconds default to
0.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.Nanoseconds default to
0.If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, second, and nanosecond.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nano-of-second (0–999,999,999)- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset) Obtains an instance ofArabicDateTimefrom a specificChronology, day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.This method allows full specification of the time down to nanoseconds.
If
zoneOrOffsetis provided, the resulting date-time will be backed by anOffsetDateTimeorZonedDateTime. Ifnull, the result is backed by aLocalDateTime.- Parameters:
chronology- the chronology to use, not nullyear- the year valuearabicMonth- the Arabic month name, not nullday- the day-of-month (1–31)hour- the hour-of-day (0–23)minute- the minute-of-hour (0–59)second- the second-of-minute (0–59)nanoOfSecond- the nanosecond-of-second (0–999,999,999)zoneOrOffset- the optional time zone or offset, may benull- Returns:
- a new
ArabicDateTimeinstance, not null
-
of
Creates a newArabicDateTimeinstance.- Parameters:
naftahDate- the date componentarabicTime- the time component- Returns:
- a new
ArabicDateTimeinstance
-
of
Creates a newArabicDateTimeinstance.- Parameters:
naftahDate- the date componentarabicTime- the time componenttemporal- the resolved temporal- Returns:
- a new
ArabicDateTimeinstance
-
toEpochDay
public long toEpochDay()Returns the number of days since the epoch (1970-01-01 ISO) for the date part of thisArabicDateTime.- Specified by:
toEpochDayin interfaceDateSupport- Returns:
- the epoch day count
-
getYear
public int getYear()Returns the year of the date part of thisArabicDateTime.- Specified by:
getYearin interfaceDateSupport- Returns:
- the year value
-
getMonthValue
public int getMonthValue()Returns the numeric month value (1–12) of the date part of thisArabicDateTime.- Specified by:
getMonthValuein interfaceDateSupport- Returns:
- the month value
-
getMonth
Returns the Arabic month name of the date part of thisArabicDateTime.- Specified by:
getMonthin interfaceDateSupport- Returns:
- the Arabic month name
-
getDayOfMonth
public int getDayOfMonth()Returns the day-of-month of the date part of thisArabicDateTime.- Specified by:
getDayOfMonthin interfaceDateSupport- Returns:
- the day of the month
-
getDayOfYear
public int getDayOfYear()Returns the day-of-year of the date part of thisArabicDateTime, according to its chronology.- Specified by:
getDayOfYearin interfaceDateSupport- Returns:
- the day of the year (1–365 or 1–366 for leap years)
-
getDayOfWeek
Returns the day of the week of the date part of thisArabicDateTimeas an Arabic string.- Specified by:
getDayOfWeekin interfaceDateSupport- Returns:
- the Arabic day of the week
-
isLeapYear
public boolean isLeapYear()Checks whether the year of the date part of thisArabicDateTimeis a leap year in its chronology.- Specified by:
isLeapYearin interfaceDateSupport- Returns:
trueif it is a leap year,falseotherwise
-
lengthOfMonth
public int lengthOfMonth()Returns the length of the month in days for the date part of thisArabicDateTime.- Specified by:
lengthOfMonthin interfaceDateSupport- Returns:
- the number of days in the month
-
getHour
public int getHour()Gets the hour-of-day from the time part of thisArabicDateTime.The value is based on a 24-hour clock.
- Specified by:
getHourin interfaceTimeSupport- Returns:
- the hour-of-day, from 0 to 23
-
getMinute
public int getMinute()Gets the minute-of-hour from the time part of thisArabicDateTime.- Specified by:
getMinutein interfaceTimeSupport- Returns:
- the minute-of-hour, from 0 to 59
-
getSecond
public int getSecond()Gets the second-of-minute from the time part of thisArabicDateTime.- Specified by:
getSecondin interfaceTimeSupport- Returns:
- the second-of-minute, from 0 to 59
-
getNano
public int getNano()Gets the nano-of-second from the time part of thisArabicDateTime.- Specified by:
getNanoin interfaceTimeSupport- Returns:
- the nano-of-second, from 0 to 999,999,999
-
lengthOfYear
public int lengthOfYear()Returns the length of the year in days for the date part of thisArabicDateTime.The number of days depends on the chronology of the date:
- For Gregorian/ISO years, leap years return 366 days, non-leap years return 365 days.
- For Hijri years, leap years return 355 days, non-leap years return 354 days.
- Specified by:
lengthOfYearin interfaceDateSupport- Returns:
- the number of days in the year
-
plus
Returns a newArabicDateTimeobtained by adding the given Arabic temporal amount to this date-time.- Specified by:
plusin interfaceNaftahTemporalPoint- Parameters:
naftahTemporalAmount- the temporal amount to add- Returns:
- a new
ArabicDateTimeinstance
-
plusYears
Returns a newArabicDateTimewith the specified number of years added.- Specified by:
plusYearsin interfaceDateSupport- Parameters:
yearsToAdd- the number of years to add, may be negative- Returns:
- a new
ArabicDateTimewith the years added
-
plusMonths
Returns a newArabicDateTimewith the specified number of months added.- Specified by:
plusMonthsin interfaceDateSupport- Parameters:
monthsToAdd- the number of months to add, may be negative- Returns:
- a new
ArabicDateTimewith the months added
-
plusWeeks
Returns a newArabicDateTimewith the specified number of weeks added.- Specified by:
plusWeeksin interfaceDateSupport- Parameters:
weeksToAdd- the number of weeks to add, may be negative- Returns:
- a new
ArabicDateTimewith the weeks added
-
plusDays
Returns a newArabicDateTimewith the specified number of days added.- Specified by:
plusDaysin interfaceDateSupport- Parameters:
daysToAdd- the number of days to add, may be negative- Returns:
- a new
ArabicDateTimewith the days added
-
plusHours
Returns a newArabicDateTimewith the specified number of hours added.- Specified by:
plusHoursin interfaceTimeSupport- Parameters:
hoursToAdd- the number of hours to add, may be negative- Returns:
- a new
ArabicDateTimewith the hours added
-
plusMinutes
Returns a newArabicDateTimewith the specified number of minutes added.- Specified by:
plusMinutesin interfaceTimeSupport- Parameters:
minutesToAdd- the number of minutes to add, may be negative- Returns:
- a new
ArabicDateTimewith the minutes added
-
plusSeconds
Returns a newArabicDateTimewith the specified number of seconds added.- Specified by:
plusSecondsin interfaceTimeSupport- Parameters:
secondsToAdd- the number of seconds to add, may be negative- Returns:
- a new
ArabicDateTimewith the seconds added
-
plusNanos
Returns a newArabicDateTimewith the specified number of nanoseconds added.- Specified by:
plusNanosin interfaceTimeSupport- Parameters:
nanosToAdd- the number of nanoseconds to add, may be negative- Returns:
- a new
ArabicDateTimewith the nanoseconds added
-
minus
Returns a newArabicDateTimeobtained by subtracting the given Arabic temporal amount from this date-time.- Specified by:
minusin interfaceNaftahTemporalPoint- Parameters:
naftahTemporalAmount- the temporal amount to subtract- Returns:
- a new
ArabicDateTimeinstance
-
minusYears
Returns a newArabicDateTimewith the specified number of years subtracted.- Specified by:
minusYearsin interfaceDateSupport- Parameters:
yearsToSubtract- the number of years to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the years subtracted
-
minusMonths
Returns a newArabicDateTimewith the specified number of months subtracted.- Specified by:
minusMonthsin interfaceDateSupport- Parameters:
monthsToSubtract- the number of months to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the months subtracted
-
minusWeeks
Returns a newArabicDateTimewith the specified number of weeks subtracted.- Specified by:
minusWeeksin interfaceDateSupport- Parameters:
weeksToSubtract- the number of weeks to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the weeks subtracted
-
minusDays
Returns a newArabicDateTimewith the specified number of days subtracted.- Specified by:
minusDaysin interfaceDateSupport- Parameters:
daysToSubtract- the number of days to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the days subtracted
-
minusHours
Returns a newArabicDateTimewith the specified number of hours subtracted.- Specified by:
minusHoursin interfaceTimeSupport- Parameters:
hoursToSubtract- the number of hours to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the hours subtracted
-
minusMinutes
Returns a newArabicDateTimewith the specified number of minutes subtracted.- Specified by:
minusMinutesin interfaceTimeSupport- Parameters:
minutesToSubtract- the number of minutes to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the minutes subtracted
-
minusSeconds
Returns a newArabicDateTimewith the specified number of seconds subtracted.- Specified by:
minusSecondsin interfaceTimeSupport- Parameters:
secondsToSubtract- the number of seconds to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the seconds subtracted
-
minusNanos
Returns a newArabicDateTimewith the specified number of nanoseconds subtracted.- Specified by:
minusNanosin interfaceTimeSupport- Parameters:
nanosToSubtract- the number of nanoseconds to subtract, may be negative- Returns:
- a new
ArabicDateTimewith the nanoseconds subtracted
-
compute
Computes a newArabicDateTimeby applying the given Arabic temporal amount using either addition or subtraction.Supported temporal amounts:
Duration handling rules:
- Durations shorter than 24 hours affect only the time component
- Durations of 24 hours or more are split into a date-based
Periodand a remaining time-basedDuration
Date and time components are updated independently while the resolved
Temporalis updated in full.- Parameters:
arabicTemporalAmount- the temporal amount to applyplus-trueto add,falseto subtract- Returns:
- a new
ArabicDateTimeinstance
-
toString
Returns a string representation of thisArabicDateTimein the format: "date time".Both
NaftahDateandNaftahTimecomponents are included. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
naftahDate
Returns the value of thenaftahDaterecord component.- Returns:
- the value of the
naftahDaterecord component
-
naftahTime
Returns the value of thenaftahTimerecord component.- Returns:
- the value of the
naftahTimerecord component
-
temporal
Returns the value of thetemporalrecord component.- Specified by:
temporalin interfaceNaftahTemporalPoint- Returns:
- the value of the
temporalrecord component
-