Package gnu.io.factory
Class RxTxPortCreator
- java.lang.Object
-
- gnu.io.factory.RxTxPortCreator
-
- All Implemented Interfaces:
SerialPortCreator<RXTXPort>
public class RxTxPortCreator extends java.lang.Object implements SerialPortCreator<RXTXPort>
-
-
Field Summary
-
Fields inherited from interface gnu.io.factory.SerialPortCreator
LOCAL
-
-
Constructor Summary
Constructors Constructor Description RxTxPortCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RXTXPortcreatePort(java.lang.String port)Creates theSerialPortand opens it for communication.java.lang.StringgetProtocol()Gets the protocol type of the Port to create.booleanisApplicable(java.lang.String portName, java.lang.Class<RXTXPort> expectedClass)Gets whether thisSerialPortCreatoris applicable to create and open the given port.
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(java.lang.String portName, java.lang.Class<RXTXPort> expectedClass)Description copied from interface:SerialPortCreatorGets whether thisSerialPortCreatoris applicable to create and open the given port.- Specified by:
isApplicablein interfaceSerialPortCreator<RXTXPort>- Parameters:
portName- The ports name.- Returns:
- Whether the port can be created and opened by this creator.
-
createPort
public RXTXPort createPort(java.lang.String port) throws NoSuchPortException, UnsupportedCommOperationException, PortInUseException
Description copied from interface:SerialPortCreatorCreates theSerialPortand opens it for communication.- Specified by:
createPortin interfaceSerialPortCreator<RXTXPort>- Parameters:
port- The ports name.- Returns:
- The created
SerialPort. - Throws:
NoSuchPortException- If the serial port does not exist.UnsupportedCommOperationExceptionPortInUseException
-
getProtocol
public java.lang.String getProtocol()
Description copied from interface:SerialPortCreatorGets the protocol type of the Port to create.- Specified by:
getProtocolin interfaceSerialPortCreator<RXTXPort>- Returns:
- The protocol type.
-
-