Class IntSet

java.lang.Object
hudson.plugins.cmake.IntSet

public class IntSet extends Object
A set of int values that can be expressed as a String.
Author:
Martin Weber
  • Constructor Details

    • IntSet

      public IntSet()
      Constructs a new object that does not contain any number.
    • IntSet

      public IntSet(String rangeSpecification)
      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,
      • null for an empty range
      • the empty string for empty range.
      Throws:
      IllegalArgumentException - if the given range specification string is invalid
      See Also:
  • Method Details

    • setValues

      public void setValues(String rangeSpecification)
      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,
      • null for an empty range
      • the empty string for empty range.
      Throws:
      IllegalArgumentException - if the given range specification string is invalid
      See Also:
    • isEmpty

      public boolean isEmpty()
      Gets whether this IntSet is empty.
      Returns:
      true if this IntSet is empty, otherwise false
      See Also:
    • contains

      public boolean contains(int value)
      Gets whether the specified value is contained in this set of values.
    • toSpecificationString

      public String toSpecificationString()
      Gets this object as a range specification string which can safely be parsed by setValues(String).
      Returns:
      a range specification string, never null. The empty string is returned when this set is empty.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • iterator

      public Iterator<Integer> iterator()
      Gets an iterator over all values.
      Returns:
      the iterator
      See Also: