- java.lang.Object
-
- java.lang.Enum<FlowControl>
-
- swim.io.FlowControl
-
- All Implemented Interfaces:
Serializable,Comparable<FlowControl>,Constable,Debug
public enum FlowControl extends Enum<FlowControl> implements Debug
Network channel flow state, controlling accept, connect, read, and write operations.- See Also:
FlowModifier,FlowContext
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCEPTaccept enabled; connect, read, and write disabled.ACCEPT_CONNECTaccept and connect enabled; read and write disabled.ACCEPT_CONNECT_READaccept, connect, and read enabled; write disabled.ACCEPT_CONNECT_READ_WRITEaccept, connect, read, and write enabled.ACCEPT_CONNECT_WRITEaccept, connect, and write enabled; read disabled.ACCEPT_READaccept and read enabled; connect and write disabled.ACCEPT_READ_WRITEaccept, read, and write enabled; connect disabled.ACCEPT_WRITEaccept and write enabled; connect and read disabled.CONNECTconnect enabled; accept, read, and write disabled.CONNECT_READconnect and read enabled; accept and write disabled.CONNECT_READ_WRITEconnect, read, and write enabled; accept disabled.CONNECT_WRITEconnect and write enabled; accept and read disabled.READread enabled; accept, connect, and write disabled.READ_WRITEread and write enabled; accept and connect disabled.WAITaccept, connect, read, and write disabled.WRITEwrite enabled; accept, connect, and read disabled.
-
Method Summary
Modifier and Type Method Description FlowControlacceptDisabled()Returns an updatedFlowControlwith its accept operation disabled.FlowControlacceptEnabled()Returns an updatedFlowControlwith its accept operation enabled.FlowControland(FlowControl that)Returns theFlowControlwith all operations enabled inthisandthatenabled.FlowControlconnectDisabled()Returns an updatedFlowControlwith its connect operation disabled.FlowControlconnectEnabled()Returns an updatedFlowControlwith its connect operation enabled.voiddebug(Output<?> output)Writes a developer readable, debug-formatted string representation of this object tooutput.static FlowControlfromSelectorOps(int selectorOps)Returns theFlowControlcorresponding to the givenSelectionKeyinterest set.booleanisAcceptEnabled()Returnstrueif the accept operation is enabled.booleanisConnectEnabled()Returnstrueif the connect operation is enabled.booleanisReadEnabled()Returnstrueif the read operation is enabled.booleanisWriteEnabled()Returnstrueif the write operation is enabled.FlowControlmodify(FlowModifier flowModifier)Returns an updatedFlowControlwith its read and write operations patched by aflowModifierdelta.FlowControlnot()Returns theFlowControlwith all operations enabled inthisdisabled, and all operations disabled inthisenabled.FlowControlor(FlowControl that)Returns theFlowControlwith all operations enabled inthisorthatenabled.FlowControlreadDisabled()Returns an updatedFlowControlwith its read operation disabled.FlowControlreadEnabled()Returns an updatedFlowControlwith its read operation enabled.inttoSelectorOps()Returns theSelectionKeyinterest set corresponding to thisFlowControl.static FlowControlvalueOf(String name)Returns the enum constant of this type with the specified name.static FlowControl[]values()Returns an array containing the constants of this enum type, in the order they are declared.FlowControlwriteDisabled()Returns an updatedFlowControlwith its write operation disabled.FlowControlwriteEnabled()Returns an updatedFlowControlwith its write operation enabled.FlowControlxor(FlowControl that)Returns theFlowControlwith all operations enabled inthisorthat—but not both—enabled.
-
-
-
Enum Constant Detail
-
WAIT
public static final FlowControl WAIT
accept, connect, read, and write disabled.
-
ACCEPT
public static final FlowControl ACCEPT
accept enabled; connect, read, and write disabled.
-
CONNECT
public static final FlowControl CONNECT
connect enabled; accept, read, and write disabled.
-
ACCEPT_CONNECT
public static final FlowControl ACCEPT_CONNECT
accept and connect enabled; read and write disabled.
-
READ
public static final FlowControl READ
read enabled; accept, connect, and write disabled.
-
ACCEPT_READ
public static final FlowControl ACCEPT_READ
accept and read enabled; connect and write disabled.
-
CONNECT_READ
public static final FlowControl CONNECT_READ
connect and read enabled; accept and write disabled.
-
ACCEPT_CONNECT_READ
public static final FlowControl ACCEPT_CONNECT_READ
accept, connect, and read enabled; write disabled.
-
WRITE
public static final FlowControl WRITE
write enabled; accept, connect, and read disabled.
-
ACCEPT_WRITE
public static final FlowControl ACCEPT_WRITE
accept and write enabled; connect and read disabled.
-
CONNECT_WRITE
public static final FlowControl CONNECT_WRITE
connect and write enabled; accept and read disabled.
-
ACCEPT_CONNECT_WRITE
public static final FlowControl ACCEPT_CONNECT_WRITE
accept, connect, and write enabled; read disabled.
-
READ_WRITE
public static final FlowControl READ_WRITE
read and write enabled; accept and connect disabled.
-
ACCEPT_READ_WRITE
public static final FlowControl ACCEPT_READ_WRITE
accept, read, and write enabled; connect disabled.
-
CONNECT_READ_WRITE
public static final FlowControl CONNECT_READ_WRITE
connect, read, and write enabled; accept disabled.
-
ACCEPT_CONNECT_READ_WRITE
public static final FlowControl ACCEPT_CONNECT_READ_WRITE
accept, connect, read, and write enabled.
-
-
Method Detail
-
values
public static FlowControl[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FlowControl 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
-
fromSelectorOps
public static FlowControl fromSelectorOps(int selectorOps)
Returns theFlowControlcorresponding to the givenSelectionKeyinterest set.
-
isAcceptEnabled
public boolean isAcceptEnabled()
Returnstrueif the accept operation is enabled.
-
isConnectEnabled
public boolean isConnectEnabled()
Returnstrueif the connect operation is enabled.
-
isReadEnabled
public boolean isReadEnabled()
Returnstrueif the read operation is enabled.
-
isWriteEnabled
public boolean isWriteEnabled()
Returnstrueif the write operation is enabled.
-
acceptDisabled
public FlowControl acceptDisabled()
Returns an updatedFlowControlwith its accept operation disabled.
-
acceptEnabled
public FlowControl acceptEnabled()
Returns an updatedFlowControlwith its accept operation enabled.
-
connectDisabled
public FlowControl connectDisabled()
Returns an updatedFlowControlwith its connect operation disabled.
-
connectEnabled
public FlowControl connectEnabled()
Returns an updatedFlowControlwith its connect operation enabled.
-
readDisabled
public FlowControl readDisabled()
Returns an updatedFlowControlwith its read operation disabled.
-
readEnabled
public FlowControl readEnabled()
Returns an updatedFlowControlwith its read operation enabled.
-
writeDisabled
public FlowControl writeDisabled()
Returns an updatedFlowControlwith its write operation disabled.
-
writeEnabled
public FlowControl writeEnabled()
Returns an updatedFlowControlwith its write operation enabled.
-
modify
public FlowControl modify(FlowModifier flowModifier)
Returns an updatedFlowControlwith its read and write operations patched by aflowModifierdelta.
-
or
public FlowControl or(FlowControl that)
Returns theFlowControlwith all operations enabled inthisorthatenabled.
-
xor
public FlowControl xor(FlowControl that)
Returns theFlowControlwith all operations enabled inthisorthat—but not both—enabled.
-
and
public FlowControl and(FlowControl that)
Returns theFlowControlwith all operations enabled inthisandthatenabled.
-
not
public FlowControl not()
Returns theFlowControlwith all operations enabled inthisdisabled, and all operations disabled inthisenabled.
-
toSelectorOps
public int toSelectorOps()
Returns theSelectionKeyinterest set corresponding to thisFlowControl.
-
-