Class Seconds

java.lang.Object
com.oracle.coherence.common.util.Duration
com.tangosol.coherence.config.unit.Seconds

public class Seconds extends com.oracle.coherence.common.util.Duration
Seconds is a specialized Duration whose default constructor assumes that the specified units of time (when the unit magnitude is not specified) are seconds.

Note: This class is provided to simplify and support backwards compatibility during the injection of second-based units of time into appropriate classes. This class is not designed for general purpose representation of units of time. For general purpose units of time, please use the Duration class.

Since:
Coherence 12.1.2
Author:
bo 2012.01.18
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.coherence.common.util.Duration

    com.oracle.coherence.common.util.Duration.Magnitude
  • Constructor Summary

    Constructors
    Constructor
    Description
    Seconds(int c)
    Constructs a Seconds representing a Duration measured in seconds.
    Seconds(com.oracle.coherence.common.util.Duration d)
    Constructs a Seconds based on another Duration.
    Constructs a Seconds representing a Duration measured in seconds.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    get()
    Obtain the Duration in units of seconds.

    Methods inherited from class com.oracle.coherence.common.util.Duration

    as, asJavaDuration, equals, getNanos, hashCode, toString, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Seconds

      public Seconds(com.oracle.coherence.common.util.Duration d)
      Constructs a Seconds based on another Duration.
      Parameters:
      d - the Duration
    • Seconds

      public Seconds(int c)
      Constructs a Seconds representing a Duration measured in seconds.
      Parameters:
      c - the number of seconds
    • Seconds

      public Seconds(String s)
      Constructs a Seconds representing a Duration measured in seconds.
      Parameters:
      s - the number of seconds or other duration when magnitudes are specified
      See Also:
      • Duration(String, Magnitude)
  • Method Details

    • get

      public long get()
      Obtain the Duration in units of seconds.
      Returns:
      the number of seconds in the Duration