Module org.refcodes.serial
Package org.refcodes.serial
Interface PortHub<PORT extends Port<PM>,PM extends PortMetrics>
- Type Parameters:
PORT- The actualPorttype to use.PM- The actualPortMetricstype to use.
- All Known Implementing Classes:
CrossoverLoopbackPortHub,LoopbackPortHub
public interface PortHub<PORT extends Port<PM>,PM extends PortMetrics>
-
Method Summary
Modifier and TypeMethodDescriptionPORT[]ports()Lists the available ports of the system.default PORT[]Returns the available ports of the system which'sAliasAccessor.getAlias()matches the given pattern.default PORTReturns thePortidentified by the given alias.Returns thePortidentified by the given alias.
-
Method Details
-
ports
Lists the available ports of the system.- Returns:
- An array of available
Portinstances, if there are no ports than an empty array (size 0) is returned. - Throws:
IOException- Thrown in case accessing the list ofPortinstances failed due to I/O problems.
-
toPort
Returns thePortidentified by the given alias.- Parameters:
aAlias- The alias identifying the givenPort.- Returns:
- The given
Port. - Throws:
IOException- Thrown in case accessing the list ofPortinstances failed due to I/O problems.
-
toPort
Returns thePortidentified by the given alias.- Parameters:
aAlias- The alias identifying the givenPort.aPortMetrics- ThePortMetricsto use when opening the port without providing any specific arguments.- Returns:
- The given
Port. - Throws:
IOException- Thrown in case accessing the list ofPortinstances failed due to I/O problems.
-
ports
Returns the available ports of the system which'sAliasAccessor.getAlias()matches the given pattern.- Parameters:
aPattern- The pattern of theAliasAccessor.getAlias()to match. A "*" stands for any chars, "?" stands for a single name (similar to filename wildcards).- Returns:
- An array of available
Portinstances which'sAliasAccessor.getAlias()matches the given pattern or an empty array (size = 0) if there are none such ports. - Throws:
IOException- Thrown in case accessing the list ofPortinstances failed due to I/O problems.
-