Module org.refcodes.serial
Package org.refcodes.serial
Interface PortHub<PORT extends Port<PM>,PM extends PortMetrics>
-
- Type Parameters:
PORT
- The actualPort
type to use.PM
- The actualPortMetrics
type to use.
- All Known Implementing Classes:
CrossoverLoopbackPortHub
,LoopbackPortHub
public interface PortHub<PORT extends Port<PM>,PM extends PortMetrics>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description PORT[]
ports()
Lists the available ports of the system.default PORT[]
ports(String aPattern)
Returns the available ports of the system which'sAliasAccessor.getAlias()
matches the given pattern.default PORT
toPort(String aAlias)
Returns thePort
identified by the given alias.
-
-
-
Method Detail
-
ports
PORT[] ports() throws IOException
Lists the available ports of the system.- Returns:
- An array of available
Port
instances, if there are no ports than an empty array (size 0) is returned. - Throws:
IOException
- Thrown in case accessing the list ofPort
instances failed due to I/O problems.
-
toPort
default PORT toPort(String aAlias) throws NoSuchPortExcpetion, IOException
Returns thePort
identified by the given alias.- Parameters:
aAlias
- The alias identifying the givenPort
.- Returns:
- The given
Port
. - Throws:
NoSuchPortExcpetion
- thrown in case there is no such port found.IOException
- Thrown in case accessing the list ofPort
instances failed due to I/O problems.
-
ports
default PORT[] ports(String aPattern) throws IOException
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
Port
instances 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 ofPort
instances failed due to I/O problems.
-
-