case class Seconds extends TemporalAmount with Product with Serializable

An immutable time period representing a number of seconds.

Source
Seconds.scala
Linear Supertypes
Serializable, Product, Equals, TemporalAmount, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Seconds
  2. Serializable
  3. Product
  4. Equals
  5. TemporalAmount
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addTo(temporal: Temporal): Temporal

    Adds this duration to the specified temporal object.

    Adds this duration to the specified temporal object.

    This returns a temporal object of the same observable type as the input with this duration added.

    In most cases, it is clearer to reverse the calling pattern by using Temporal#plus(TemporalAmount).

      // these two lines are equivalent, but the second approach is recommended
      dateTime = thisDuration.addTo(dateTime);
      dateTime = dateTime.plus(thisDuration);
    

    The calculation will add the seconds, then nanos. Only non-zero amounts will be added.

    This instance is immutable and unaffected by this method call.

    temporal

    the temporal object to adjust, not null

    returns

    an object of the same type with the adjustment made, not null

    Definition Classes
    Seconds → TemporalAmount
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if unable to add

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  7. val duration: Duration
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def get(unit: TemporalUnit): Long

    Gets the value of the requested unit.

    Gets the value of the requested unit.

    This returns a value for each of the two supported units, SECONDS and NANOS. All other units throw an exception.

    unit

    the { @code TemporalUnit} for which to return the value

    returns

    the long value of the unit

    Definition Classes
    Seconds → TemporalAmount
    Exceptions thrown

    DateTimeException if the unit is not supported

    UnsupportedTemporalTypeException if the unit is not supported

  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. def getUnits(): List[TemporalUnit]

    Gets the set of units supported by this duration.

    Gets the set of units supported by this duration.

    The supported units are SECONDS, and NANOS. They are returned in the order seconds, nanos.

    This set can be used in conjunction with #get(TemporalUnit) to access the entire state of the duration.

    returns

    a list containing the seconds and nanos units, not null

    Definition Classes
    Seconds → TemporalAmount
  12. def isGreaterThan(other: Seconds): Boolean

    Is this seconds instance greater than the specified number of seconds.

    Is this seconds instance greater than the specified number of seconds.

    other

    the other period, null means zero

    returns

    true if this seconds instance is greater than the specified one

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def isLessThan(other: Seconds): Boolean

    Is this seconds instance less than the specified number of seconds.

    Is this seconds instance less than the specified number of seconds.

    other

    the other period, null means zero

    returns

    true if this seconds instance is less than the specified one

  15. def minus(other: Seconds): Seconds

    Returns a new instance with the specified number of seconds taken away.

    Returns a new instance with the specified number of seconds taken away.

    This instance is immutable and unaffected by this method call.

    other

    the amount of seconds to take away, may be negative, null means zero

    returns

    the new period minus the specified number of seconds

    Exceptions thrown

    ArithmeticException if the result overflows an int

  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. def plus(other: Seconds): Seconds

    Returns a new instance with the specified number of seconds added.

    Returns a new instance with the specified number of seconds added.

    This instance is immutable and unaffected by this method call.

    other

    the amount of seconds to add, may be negative, null means zero

    returns

    the new period plus the specified number of seconds

    Exceptions thrown

    ArithmeticException if the result overflows an int

  20. def productElementNames: Iterator[String]
    Definition Classes
    Product
  21. def seconds: Long

    Gets the number of seconds that this period represents.

    Gets the number of seconds that this period represents.

    returns

    the number of seconds in the period

  22. def subtractFrom(temporal: Temporal): Temporal

    Subtracts this duration from the specified temporal object.

    Subtracts this duration from the specified temporal object.

    This returns a temporal object of the same observable type as the input with this duration subtracted.

    In most cases, it is clearer to reverse the calling pattern by using Temporal#minus(TemporalAmount).

      // these two lines are equivalent, but the second approach is recommended
      dateTime = thisDuration.subtractFrom(dateTime);
      dateTime = dateTime.minus(thisDuration);
    

    The calculation will subtract the seconds, then nanos. Only non-zero amounts will be added.

    This instance is immutable and unaffected by this method call.

    temporal

    the temporal object to adjust, not null

    returns

    an object of the same type with the adjustment made, not null

    Definition Classes
    Seconds → TemporalAmount
    Exceptions thrown

    ArithmeticException if numeric overflow occurs

    DateTimeException if unable to subtract

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String

    Gets this instance as a String in the ISO8601 duration format.

    Gets this instance as a String in the ISO8601 duration format.

    For example, "PT4S" represents 4 seconds.

    returns

    the value as an ISO8601 string

    Definition Classes
    Seconds → AnyRef → Any
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from TemporalAmount

Inherited from AnyRef

Inherited from Any

Ungrouped