Enum IoTimeout

  • All Implemented Interfaces:
    Serializable, Comparable<IoTimeout>, org.refcodes.mixin.TimeInMsAccessor

    public enum IoTimeout
    extends Enum<IoTimeout>
    implements org.refcodes.mixin.TimeInMsAccessor
    The IoTimeout defines values used inside a IO processing control flow.
    • Method Detail

      • values

        public static IoTimeout[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (IoTimeout c : IoTimeout.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static IoTimeout valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getTimeInMs

        public int getTimeInMs()
        Specified by:
        getTimeInMs in interface org.refcodes.mixin.TimeInMsAccessor
      • 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.