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 protectedAbstractPorts(Set<E> ports)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(E port)Test if a port exists by testing if port name exists.booleancontains(String name)Test if a port exists.intcountDataFormat(DataFormat format)Count the number of occurrences of a format in the port.EgetFirstPort()Get the first port.EgetPort(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.booleanisEmpty()Test if the object is emptyIterator<E>iterator()intsize()Get the number of ports in the object.StringtoString()-
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:PortsTest if a port exists.
-
contains
public boolean contains(E port)
Description copied from interface:PortsTest if a port exists by testing if port name exists.
-
getPortNames
public Set<String> getPortNames()
Description copied from interface:PortsGet the names of the ports- Specified by:
getPortNamesin interfacePorts<E extends Port>- Returns:
- a set with the names of the ports
-
size
public int size()
Description copied from interface:PortsGet the number of ports in the object.
-
isEmpty
public boolean isEmpty()
Description copied from interface:PortsTest if the object is empty
-
getFirstPort
public E getFirstPort()
Description copied from interface:PortsGet the first port.- Specified by:
getFirstPortin 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:PortsCount the number of occurrences of a format in the port.- Specified by:
countDataFormatin 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:PortsGet a list with all the ports that format is the specified format.- Specified by:
getPortsWithDataFormatin interfacePorts<E extends Port>- Parameters:
format- the format to get- Returns:
- always a list (even empty) of Ports
-
-