Modifier and Type | Class and Description |
---|---|
class |
PortRange.RandomIterator
An iterator that can be used to randomly iterate through
all possible values of the disjoint range.
|
Constructor and Description |
---|
PortRange()
Create an empty port range.
|
PortRange(Set<Integer> rangeSet)
Create a port range including all elements in a set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int i)
Returns true if this range contains the
specified element.
|
static PortRange |
createPortRange(String ranges)
This method can be used to create sets containing all the
possible values in a multiple partial ranges.
|
Integer |
getRandomElement()
Returns a random element contained by
the port range or null if the range is empty.
|
Iterator<Integer> |
iterator() |
int |
size()
Returns the number of elements in the range.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static PortRange createPortRange(String ranges)
ranges
- a string with the required formatpublic int size()
public boolean contains(int i)
i
- element to be checked for containment in this rangepublic Integer getRandomElement()
Copyright © 2021 Actian Corporation. All rights reserved.