public class PortRange extends Object
Constructor and Description |
---|
PortRange(Port lowerPort,
Port higherPort)
Create a new port range, which represents all possible ports within the interval [lowerPort;upperPort], inclusive
|
Modifier and Type | Method and Description |
---|---|
Port |
getHigherPort() |
Port |
getLowerPort() |
boolean |
isWithinRange(Port port)
Checks whether the given port is within this range, i.e.
|
void |
setHigherPort(Port higherPort)
Sets the upper bound of this range
|
void |
setLowerPort(Port lowerPort)
Sets the lower bound of the range
|
public PortRange(Port lowerPort, Port higherPort)
lowerPort
- the lower bound of the range, must be less than higherPort.higherPort
- the upper bound of the range, must be greater than lowerPort.IllegalArgumentException
- if invalid arguments are passedpublic boolean isWithinRange(Port port)
port
- to checkIllegalArgumentException
- if the port is nullpublic Port getHigherPort()
public void setHigherPort(Port higherPort)
higherPort
- the upper bound of the range, must be greater than lowerPort.public Port getLowerPort()
public void setLowerPort(Port lowerPort)
lowerPort
- the lower bound of the range, must be less than higherPort.Copyright © 2013–2015 Institute of networks and security. All rights reserved.