Class AbstractPorts<E extends Port>
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.AbstractPorts<E>
-
- All Implemented Interfaces:
Ports<E>
,Serializable
,Iterable<E>
- Direct Known Subclasses:
SimpleInputPorts
,SimpleOutputPorts
public abstract class AbstractPorts<E extends Port> extends Object implements Ports<E>, Serializable
This class define a basic implementation of a Ports class.- Since:
- 2.0
- Author:
- Laurent Jourdren
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPorts(Set<E> ports)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete 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 emptyIterator<E>
iterator()
int
size()
Get the number of ports in the object.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
contains
public boolean contains(String name)
Description copied from interface:Ports
Test if a port exists.
-
contains
public boolean contains(E port)
Description copied from interface:Ports
Test if a port exists by testing if port name exists.
-
getPortNames
public Set<String> getPortNames()
Description copied from interface:Ports
Get the names of the ports- Specified by:
getPortNames
in interfacePorts<E extends Port>
- Returns:
- a set with the names of the ports
-
size
public int size()
Description copied from interface:Ports
Get the number of ports in the object.
-
isEmpty
public boolean isEmpty()
Description copied from interface:Ports
Test if the object is empty
-
getFirstPort
public E getFirstPort()
Description copied from interface:Ports
Get the first port.- Specified by:
getFirstPort
in interfacePorts<E extends Port>
- Returns:
- a port or null if the object does not contains ports.
-
countDataFormat
public int countDataFormat(DataFormat format)
Description copied from interface:Ports
Count the number of occurrences of a format in the port.- Specified by:
countDataFormat
in interfacePorts<E extends Port>
- Parameters:
format
- the format to test- Returns:
- the number of occurrences of the format
-
getPortsWithDataFormat
public List<E> getPortsWithDataFormat(DataFormat format)
Description copied from interface:Ports
Get a list with all the ports that format is the specified format.- Specified by:
getPortsWithDataFormat
in interfacePorts<E extends Port>
- Parameters:
format
- the format to get- Returns:
- always a list (even empty) of Ports
-
-