Package hudson.model
Class Fingerprint.RangeSet
java.lang.Object
hudson.model.Fingerprint.RangeSet
- Enclosing class:
- Fingerprint
Set of
Fingerprint.Range
s. Mutable.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Converter Implementation for RangeSet. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int n) Expands the range set to include the given value.void
add
(Fingerprint.RangeSet that) void
addAll
(int... n) boolean
static Fingerprint.RangeSet
fromString
(String list, boolean skipError) Parses aFingerprint.RangeSet
from a string like "1-3,5,7-9"Gets all the ranges.int
hashCode()
boolean
includes
(int i) boolean
isEmpty()
boolean
isSmallerThan
(int n) Returns true if all the integers logically in thisFingerprint.RangeSet
is smaller than the given integer.List all numbers in this range set, in the ascending order.List all numbers in this range set in the descending order.int
max()
Returns the largest value in this range.int
min()
Returns the smallest value in this range.boolean
Updates this range set by removing all the values in the given range set.boolean
Updates this range set by the intersection of this range and the given range.toString()
-
Constructor Details
-
RangeSet
public RangeSet()
-
-
Method Details
-
listNumbers
List all numbers in this range set, in the ascending order. -
listNumbersReverse
List all numbers in this range set in the descending order. -
getRanges
Gets all the ranges. -
add
public void add(int n) Expands the range set to include the given value. If the set already includes this number, this will be a no-op. -
addAll
public void addAll(int... n) -
includes
public boolean includes(int i) -
add
-
retainAll
Updates this range set by the intersection of this range and the given range.- Returns:
- true if this range set was modified as a result.
-
removeAll
Updates this range set by removing all the values in the given range set.- Returns:
- true if this range set was modified as a result.
-
toString
-
equals
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
min
public int min()Returns the smallest value in this range.If this range is empty, this method throws an exception.
-
max
public int max()Returns the largest value in this range.If this range is empty, this method throws an exception.
-
isSmallerThan
public boolean isSmallerThan(int n) Returns true if all the integers logically in thisFingerprint.RangeSet
is smaller than the given integer. For example, {[1,3)} is smaller than 3, but {[1,3),[100,105)} is not smaller than anything less than 105. Note that {} is smaller than any n. -
fromString
Parses aFingerprint.RangeSet
from a string like "1-3,5,7-9"
-