Package gnu.io.rfc2217
Class PurgeDataCommand
- java.lang.Object
-
- gnu.io.rfc2217.ComPortCommand
-
- gnu.io.rfc2217.PurgeDataCommand
-
public class PurgeDataCommand extends ComPortCommand
RFC 2217PURGE-DATA
command.- See Also:
- RFC 2217
-
-
Constructor Summary
Constructors Constructor Description PurgeDataCommand(boolean client, int purgeData)
Encoding constructor.PurgeDataCommand(int[] bytes)
Decoding constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isPurgeReceiveDataBuffer()
boolean
isPurgeTransmitDataBuffer()
java.lang.String
toString()
Get the human-readable description of this option.void
visit(ComPortCommandSwitch sw)
Apply visitor pattern.-
Methods inherited from class gnu.io.rfc2217.ComPortCommand
equals, getBytes, getCommand, getName, hashCode, isServerCommand
-
-
-
-
Constructor Detail
-
PurgeDataCommand
public PurgeDataCommand(int[] bytes)
Decoding constructor.- Parameters:
bytes
- encoded option starting with theCOM-PORT-OPTION
byte NullPointerException ifbytes
is null IllegalArgumentException ifbytes
has length != 3 IllegalArgumentException ifbytes[0]
is notRFC2217.COM_PORT_OPTION
IllegalArgumentException ifbytes[1]
is notRFC2217.PURGE_DATA
(client or server) IllegalArgumentException ifbytes[2]
is not a valid RFC 2217 purge data value
-
PurgeDataCommand
public PurgeDataCommand(boolean client, int purgeData)
Encoding constructor.- Parameters:
purgeData
- purge data valueclient
- true for the client-to-server command, false for the server-to-client command IllegalArgumentException ifpurgeData
is not a valid RFC 2217 purge data value
-
-
Method Detail
-
toString
public java.lang.String toString()
Description copied from class:ComPortCommand
Get the human-readable description of this option.- Specified by:
toString
in classComPortCommand
-
visit
public void visit(ComPortCommandSwitch sw)
Description copied from class:ComPortCommand
Apply visitor pattern.- Specified by:
visit
in classComPortCommand
- Parameters:
sw
- visitor switch handler
-
isPurgeReceiveDataBuffer
public boolean isPurgeReceiveDataBuffer()
-
isPurgeTransmitDataBuffer
public boolean isPurgeTransmitDataBuffer()
-
-