Enum Class IoTimeout

java.lang.Object
java.lang.Enum<IoTimeout>
org.refcodes.data.IoTimeout
All Implemented Interfaces:
Serializable, Comparable<IoTimeout>, Constable, TimeMillisAccessor

public enum IoTimeout extends Enum<IoTimeout> implements TimeMillisAccessor
The IoTimeout defines values used inside a IO processing control flow.
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static IoTimeout[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static IoTimeout valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getTimeMillis

      public int getTimeMillis()
      Specified by:
      getTimeMillis in interface TimeMillisAccessor
    • toTimeoutSleepLoopTimeInMs

      public static long toTimeoutSleepLoopTimeInMs(long aIoTimeoutInMs)
      Determines the sleep time within an I/O polling timeout loop.
      Parameters:
      aIoTimeoutInMs - The overall I/O timeout.
      Returns:
      The "recommended" loop sleep time during polling.
    • toSenseTimeoutTimeframeInMs

      public static long toSenseTimeoutTimeframeInMs(long aIoTimeoutInMs)
      Determines the timeout to securely sense for a given timeout.
      Parameters:
      aIoTimeoutInMs - The overall I/O timeout within which to sense.
      Returns:
      The "recommended" timeout to securely sense within the given timeout.