Package biz.onixs.util.network
Class PortRange
- java.lang.Object
-
- biz.onixs.util.network.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intFirst()Returns the first port number in the range.intLast()Returns the last port number in the range.StringtoString()
-
-
-
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.
-
-