Class BasicDayOfYearDateTimeField


final class BasicDayOfYearDateTimeField extends PreciseDurationDateTimeField
Provides time calculations for the day of the year component of time.
Since:
1.1, refactored from GJDayOfYearDateTimeField
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public int get(long instant)
      Get the day of the year component of the specified time instant.
      Specified by:
      get in class BaseDateTimeField
      Parameters:
      instant - the time instant in millis to query.
      Returns:
      the day of the year extracted from the input.
    • getRangeDurationField

      public DurationField getRangeDurationField()
      Description copied from class: BaseDateTimeField
      Returns the range duration of this field. For example, if this field represents "hour of day", then the range duration is a day.
      Specified by:
      getRangeDurationField in class BaseDateTimeField
      Returns:
      the range duration of this field, or null if field has no range
    • getMinimumValue

      public int getMinimumValue()
      Description copied from class: PreciseDurationDateTimeField
      Get the minimum value for the field.
      Overrides:
      getMinimumValue in class PreciseDurationDateTimeField
      Returns:
      the minimum value
    • getMaximumValue

      public int getMaximumValue()
      Description copied from class: BaseDateTimeField
      Get the maximum allowable value for this field.
      Specified by:
      getMaximumValue in class BaseDateTimeField
      Returns:
      the maximum valid value for this field, in the units of the field
    • getMaximumValue

      public int getMaximumValue(long instant)
      Description copied from class: BaseDateTimeField
      Get the maximum value for this field evaluated at the specified time.

      This implementation returns the same as BaseDateTimeField.getMaximumValue().

      Overrides:
      getMaximumValue in class BaseDateTimeField
      Parameters:
      instant - the milliseconds from 1970-01-01T00:00:00Z to query
      Returns:
      the maximum value for this field, in the units of the field
    • getMaximumValue

      public int getMaximumValue(ReadablePartial partial)
      Description copied from class: BaseDateTimeField
      Get the maximum value for this field evaluated at the specified instant.

      This implementation returns the same as BaseDateTimeField.getMaximumValue().

      Overrides:
      getMaximumValue in class BaseDateTimeField
      Parameters:
      partial - the partial instant to query
      Returns:
      the maximum value for this field, in the units of the field
    • getMaximumValue

      public int getMaximumValue(ReadablePartial partial, int[] values)
      Description copied from class: BaseDateTimeField
      Get the maximum value for this field using the partial instant and the specified values.

      This implementation returns the same as BaseDateTimeField.getMaximumValue(ReadablePartial).

      Overrides:
      getMaximumValue in class BaseDateTimeField
      Parameters:
      partial - the partial instant to query
      values - the values to use
      Returns:
      the maximum value for this field, in the units of the field
    • getMaximumValueForSet

      protected int getMaximumValueForSet(long instant, int value)
      Description copied from class: PreciseDurationDateTimeField
      Called by the set method to get the maximum allowed value. By default, returns getMaximumValue(instant). Override to provide a faster implementation.
      Overrides:
      getMaximumValueForSet in class PreciseDurationDateTimeField
      Parameters:
      instant - the instant to query at
      value - the value
      Returns:
      the maximum value
    • isLeap

      public boolean isLeap(long instant)
      Description copied from class: BaseDateTimeField
      Returns whether this field is 'leap' for the specified instant.

      For example, a leap year would return true, a non leap year would return false.

      This implementation returns false.

      Overrides:
      isLeap in class BaseDateTimeField
      Parameters:
      instant - the instant to check for leap status
      Returns:
      true if the field is 'leap'
    • readResolve

      private Object readResolve()
      Serialization singleton