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:
  • Method Details

    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Iterable<E extends Port>
    • getPort

      public E getPort(String name)
      Description copied from interface: Ports
      Get a port.
      Specified by:
      getPort in interface Ports<E extends Port>
      Parameters:
      name - name of the port to get
      Returns:
      the port if exists or null
    • contains

      public boolean contains(String name)
      Description copied from interface: Ports
      Test if a port exists.
      Specified by:
      contains in interface Ports<E extends Port>
      Parameters:
      name - name of the port to test
      Returns:
      true if the port exists
    • contains

      public boolean contains(E port)
      Description copied from interface: Ports
      Test if a port exists by testing if port name exists.
      Specified by:
      contains in interface Ports<E extends Port>
      Parameters:
      port - port to test
      Returns:
      true if the port exists
    • getPortNames

      public Set<String> getPortNames()
      Description copied from interface: Ports
      Get the names of the ports
      Specified by:
      getPortNames in interface Ports<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.
      Specified by:
      size in interface Ports<E extends Port>
      Returns:
      the number of ports
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Ports
      Test if the object is empty
      Specified by:
      isEmpty in interface Ports<E extends Port>
      Returns:
      true if the object is null
    • getFirstPort

      public E getFirstPort()
      Description copied from interface: Ports
      Get the first port.
      Specified by:
      getFirstPort in interface Ports<E extends Port>
      Returns:
      a port or null if the object does not contains ports.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 interface Ports<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 interface Ports<E extends Port>
      Parameters:
      format - the format to get
      Returns:
      always a list (even empty) of Ports