Package hudson.plugins.cmake
Class IntSet
java.lang.Object
hudson.plugins.cmake.IntSet
A set of int values that can be expressed as a String.
- Author:
- Martin Weber
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int value) Gets whether the specified value is contained in this set of values.booleanisEmpty()Gets whether this IntSet is empty.iterator()Gets an iterator over all values.voidParses the given range specification string and sets the values in the set accordingly.Gets this object as a range specification string which can safely be parsed bysetValues(String).toString()
-
Constructor Details
-
IntSet
public IntSet()Constructs a new object that does not contain any number. -
IntSet
Constructs a new object that contains the values from the given range specification string.- Parameters:
rangeSpecification- the range, expressed as a String. Allowed numbers can be specified as- a comma separated list, e.g.
20,21,50, - a range, e.g.
50-70, - a combination of the above,
nullfor an empty range- the empty string for empty range.
- a comma separated list, e.g.
- Throws:
IllegalArgumentException- if the given range specification string is invalid- See Also:
-
-
Method Details
-
setValues
Parses the given range specification string and sets the values in the set accordingly.- Parameters:
rangeSpecification- the range, expressed as a String. Allowed numbers can be specified as- a comma separated list, e.g.
20,21,50, - a range, e.g.
50-70, - a combination of the above,
nullfor an empty range- the empty string for empty range.
- a comma separated list, e.g.
- Throws:
IllegalArgumentException- if the given range specification string is invalid- See Also:
-
isEmpty
public boolean isEmpty()Gets whether this IntSet is empty.- Returns:
trueif this IntSet is empty, otherwisefalse- See Also:
-
contains
public boolean contains(int value) Gets whether the specified value is contained in this set of values. -
toSpecificationString
Gets this object as a range specification string which can safely be parsed bysetValues(String).- Returns:
- a range specification string, never
null. The empty string is returned when this set is empty. - See Also:
-
toString
-
iterator
Gets an iterator over all values.- Returns:
- the iterator
- See Also:
-