Class PortRange


  • public class PortRange
    extends Object
    An immutable range of port numbers, represented from first to last port numbers.
    • Constructor Summary

      Constructors 
      Constructor Description
      PortRange()
      Constructs range of ports, where first and last port numbers are equal to 0.
      PortRange​(int singlePort)
      Constructs range of ports with a single element, where first and last port numbers are equal to specified number.
      PortRange​(int first, int last)
      Constructs range of ports with specified first and last port numbers.
    • Constructor Detail

      • PortRange

        public PortRange()
        Constructs range of ports, where first and last port numbers are equal to 0.
      • PortRange

        public PortRange​(int singlePort)
        Constructs range of ports with a single element, where first and last port numbers are equal to specified number.
        Parameters:
        singlePort - the number, first and last port numbers will be equal to.
      • PortRange

        public PortRange​(int first,
                         int last)
        Constructs range of ports with specified first and last port numbers.
        Parameters:
        first - first port number in the range.
        last - last port number in the range.
    • Method Detail

      • First

        public int First()
        Returns the first port number in the range.
        Returns:
        the first port number in the range.
      • Last

        public int Last()
        Returns the last port number in the range.
        Returns:
        the last port number in the range.