Package gnu.io.factory
Interface SerialPortCreator<T extends SerialPort>
-
- All Known Implementing Classes:
RFC2217PortCreator
,RxTxPortCreator
public interface SerialPortCreator<T extends SerialPort>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LOCAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
createPort(java.lang.String portName)
Creates theSerialPort
and opens it for communication.java.lang.String
getProtocol()
Gets the protocol type of the Port to create.boolean
isApplicable(java.lang.String portName, java.lang.Class<T> epectedClass)
Gets whether thisSerialPortCreator
is applicable to create and open the given port.
-
-
-
Field Detail
-
LOCAL
static final java.lang.String LOCAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
isApplicable
boolean isApplicable(java.lang.String portName, java.lang.Class<T> epectedClass)
Gets whether thisSerialPortCreator
is applicable to create and open the given port.- Parameters:
portName
- The ports name.- Returns:
- Whether the port can be created and opened by this creator.
-
createPort
T createPort(java.lang.String portName) throws NoSuchPortException, UnsupportedCommOperationException, PortInUseException
Creates theSerialPort
and opens it for communication.- Parameters:
portName
- The ports name.- Returns:
- The created
SerialPort
. - Throws:
NoSuchPortException
- If the serial port does not exist.UnsupportedCommOperationException
PortInUseException
-
getProtocol
java.lang.String getProtocol()
Gets the protocol type of the Port to create.- Returns:
- The protocol type.
-
-