- java.lang.Object
-
- java.lang.Enum<IoTimeout>
-
- org.refcodes.data.IoTimeout
-
- All Implemented Interfaces:
Serializable
,Comparable<IoTimeout>
,org.refcodes.mixin.TimeInMsAccessor
public enum IoTimeout extends Enum<IoTimeout> implements org.refcodes.mixin.TimeInMsAccessor
TheIoTimeout
defines values used inside a IO processing control flow.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.TimeInMsAccessor
org.refcodes.mixin.TimeInMsAccessor.TimeInMsBuilder<B extends org.refcodes.mixin.TimeInMsAccessor.TimeInMsBuilder<B>>, org.refcodes.mixin.TimeInMsAccessor.TimeInMsMutator, org.refcodes.mixin.TimeInMsAccessor.TimeInMsProperty
-
-
Field Summary
Fields Modifier and Type Field Description static int
TIMEOUT_DIVIDER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getTimeInMs()
static long
toSenseTimeoutTimeframeInMs(long aIoTimeoutInMs)
Determines the timeout to securely sense for a given timeout.static long
toTimeoutSleepLoopTimeInMs(long aIoTimeoutInMs)
Determines the sleep time within an I/O polling timeout loop.static IoTimeout
valueOf(String name)
Returns the enum constant of this type with the specified name.static IoTimeout[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Field Detail
-
TIMEOUT_DIVIDER
public static final int TIMEOUT_DIVIDER
- See Also:
- Constant Field Values
-
-
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 nameNullPointerException
- if the argument is null
-
getTimeInMs
public int getTimeInMs()
- Specified by:
getTimeInMs
in interfaceorg.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.
-
-