Interface Ports<E extends Port>
-
- All Superinterfaces:
Iterable<E>
- All Known Subinterfaces:
InputPorts
,OutputPorts
- All Known Implementing Classes:
AbstractPorts
,SimpleInputPorts
,SimpleOutputPorts
public interface Ports<E extends Port> extends Iterable<E>
This interface define a group of ports.- Since:
- 2.0
- Author:
- Laurent Jourdren
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(E port)
Test if a port exists by testing if port name exists.boolean
contains(String name)
Test if a port exists.int
countDataFormat(DataFormat format)
Count the number of occurrences of a format in the port.E
getFirstPort()
Get the first port.E
getPort(String name)
Get a port.Set<String>
getPortNames()
Get the names of the portsList<E>
getPortsWithDataFormat(DataFormat format)
Get a list with all the ports that format is the specified format.boolean
isEmpty()
Test if the object is emptyint
size()
Get the number of ports in the object.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getPort
E getPort(String name)
Get a port.- Parameters:
name
- name of the port to get- Returns:
- the port if exists or null
-
contains
boolean contains(String name)
Test if a port exists.- Parameters:
name
- name of the port to test- Returns:
- true if the port exists
-
contains
boolean contains(E port)
Test if a port exists by testing if port name exists.- Parameters:
port
- port to test- Returns:
- true if the port exists
-
getPortNames
Set<String> getPortNames()
Get the names of the ports- Returns:
- a set with the names of the ports
-
size
int size()
Get the number of ports in the object.- Returns:
- the number of ports
-
isEmpty
boolean isEmpty()
Test if the object is empty- Returns:
- true if the object is null
-
countDataFormat
int countDataFormat(DataFormat format)
Count the number of occurrences of a format in the port.- Parameters:
format
- the format to test- Returns:
- the number of occurrences of the format
-
getPortsWithDataFormat
List<E> getPortsWithDataFormat(DataFormat format)
Get a list with all the ports that format is the specified format.- Parameters:
format
- the format to get- Returns:
- always a list (even empty) of Ports
-
getFirstPort
E getFirstPort()
Get the first port.- Returns:
- a port or null if the object does not contains ports.
-
-