Package hudson.model
Class Fingerprint.RangeSet
- java.lang.Object
-
- hudson.model.Fingerprint.RangeSet
-
- Enclosing class:
- Fingerprint
@ExportedBean(defaultVisibility=3) public static final class Fingerprint.RangeSet extends Object
Set ofFingerprint.Ranges. Mutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFingerprint.RangeSet.ConverterImplConverter Implementation for RangeSet.
-
Constructor Summary
Constructors Constructor Description RangeSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int n)Expands the range set to include the given value.voidadd(Fingerprint.RangeSet that)voidaddAll(int... n)booleanequals(Object o)static Fingerprint.RangeSetfromString(String list, boolean skipError)Parses aFingerprint.RangeSetfrom a string like "1-3,5,7-9"List<Fingerprint.Range>getRanges()Gets all the ranges.inthashCode()booleanincludes(int i)booleanisEmpty()booleanisSmallerThan(int n)Returns true if all the integers logically in thisFingerprint.RangeSetis smaller than the given integer.Iterable<Integer>listNumbers()List all numbers in this range set, in the ascending order.Iterable<Integer>listNumbersReverse()List all numbers in this range set in the descending order.intmax()Returns the largest value in this range.intmin()Returns the smallest value in this range.booleanremoveAll(Fingerprint.RangeSet that)Updates this range set by removing all the values in the given range set.booleanretainAll(Fingerprint.RangeSet that)Updates this range set by the intersection of this range and the given range.StringtoString()
-
-
-
Method Detail
-
listNumbers
public Iterable<Integer> listNumbers()
List all numbers in this range set, in the ascending order.
-
listNumbersReverse
public Iterable<Integer> listNumbersReverse()
List all numbers in this range set in the descending order.
-
getRanges
@Exported public List<Fingerprint.Range> 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
public void add(Fingerprint.RangeSet that)
-
retainAll
public boolean retainAll(Fingerprint.RangeSet that)
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
public boolean removeAll(Fingerprint.RangeSet that)
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.
-
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.RangeSetis 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
public static Fingerprint.RangeSet fromString(String list, boolean skipError)
Parses aFingerprint.RangeSetfrom a string like "1-3,5,7-9"
-
-