Class AbstractPorts<E extends Port>

    • Constructor Detail

      • AbstractPorts

        protected AbstractPorts​(Set<E> ports)
        Constructor.
        Parameters:
        ports - ports of the object
    • Method Detail

      • 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.
      • 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