public class Port extends Object implements Comparable<Port>
Modifier and Type | Field and Description |
---|---|
static int |
LOWER_BOUND
the lower bound of the available port number pool
|
static int |
UPPER_BOUND
the upper bound of the available port number pool
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Port otherPort) |
static Port |
create(int portNumber)
Create a new
Port |
static Port |
getPort(int portNumber)
This method is equivalent to calling
create(int) . |
int |
getPortNumber() |
String |
toString() |
public static final int LOWER_BOUND
public static final int UPPER_BOUND
public static Port create(int portNumber)
Port
portNumber
- the port number to usePort
or
an instance of an already instantiated port.IllegalArgumentException
- if the port-number is not within the allowed rangepublic static Port getPort(int portNumber)
create(int)
.
Create a new Port
portNumber
- the port number to usePort
or
an instance of an already instantiated port.IllegalArgumentException
- if the port-number is not within the allowed rangepublic int getPortNumber()
public int compareTo(Port otherPort)
compareTo
in interface Comparable<Port>
Copyright © 2013–2015 Institute of networks and security. All rights reserved.