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 Summary
ConstructorsConstructorDescriptionDurationNudgeResultRecord(NormalizedDurationRecord duration, double total, BigInt nudgedEpochNs, boolean didExpandCalendarUnit) Creates an instance of aDurationNudgeResultRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thedidExpandCalendarUnitrecord component.duration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenudgedEpochNsrecord component.final StringtoString()Returns a string representation of this record class.doubletotal()Returns the value of thetotalrecord component.
-
Constructor Details
-
DurationNudgeResultRecord
public DurationNudgeResultRecord(NormalizedDurationRecord duration, double total, BigInt nudgedEpochNs, boolean didExpandCalendarUnit) Creates an instance of aDurationNudgeResultRecordrecord class.- Parameters:
duration- the value for thedurationrecord componenttotal- the value for thetotalrecord componentnudgedEpochNs- the value for thenudgedEpochNsrecord componentdidExpandCalendarUnit- the value for thedidExpandCalendarUnitrecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
duration
-
total
-
nudgedEpochNs
Returns the value of thenudgedEpochNsrecord component.- Returns:
- the value of the
nudgedEpochNsrecord component
-
didExpandCalendarUnit
public boolean didExpandCalendarUnit()Returns the value of thedidExpandCalendarUnitrecord component.- Returns:
- the value of the
didExpandCalendarUnitrecord component
-