Record Class RoundRelativeDurationNode.DurationNudgeResultRecord

java.lang.Object
java.lang.Record
com.oracle.truffle.js.nodes.temporal.RoundRelativeDurationNode.DurationNudgeResultRecord
Record Components:
duration - The resulting duration.
total - The possibly fractional total of the smallest unit before the rounding operation, for use in Temporal.Duration.prototype.total, or NaN if not relevant.
nudgedEpochNs - The epoch time corresponding to the rounded duration, relative to the starting point.
didExpandCalendarUnit - Whether the rounding operation caused the duration to expand to the next day or larger unit.
Enclosing class:
RoundRelativeDurationNode

public static record RoundRelativeDurationNode.DurationNudgeResultRecord(NormalizedDurationRecord duration, double total, BigInt nudgedEpochNs, boolean didExpandCalendarUnit) extends Record
A Duration Nudge Result Record is a value used to represent the result of rounding a duration up or down to an increment relative to a date-time. Returned by the following operations: NudgeToCalendarUnit, NudgeToZonedTime, NudgeToDayOrTime.
  • Constructor Details

    • DurationNudgeResultRecord

      public DurationNudgeResultRecord(NormalizedDurationRecord duration, double total, BigInt nudgedEpochNs, boolean didExpandCalendarUnit)
      Creates an instance of a DurationNudgeResultRecord record class.
      Parameters:
      duration - the value for the duration record component
      total - the value for the total record component
      nudgedEpochNs - the value for the nudgedEpochNs record component
      didExpandCalendarUnit - the value for the didExpandCalendarUnit record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • duration

      public NormalizedDurationRecord duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • total

      public double total()
      Returns the value of the total record component.
      Returns:
      the value of the total record component
    • nudgedEpochNs

      public BigInt nudgedEpochNs()
      Returns the value of the nudgedEpochNs record component.
      Returns:
      the value of the nudgedEpochNs record component
    • didExpandCalendarUnit

      public boolean didExpandCalendarUnit()
      Returns the value of the didExpandCalendarUnit record component.
      Returns:
      the value of the didExpandCalendarUnit record component