コード例 #1
0
 /**
  * Tells this generator to produce values within a specified {@linkplain InRange#min() minimum}
  * and/or {@linkplain InRange#max() maximum} inclusive, with uniform distribution.
  *
  * <p>If an endpoint of the range is not specified, its value takes on a magnitude influenced by
  * {@link com.pholser.junit.quickcheck.generator.GenerationStatus#size()}.
  *
  * @param range annotation that gives the range's constraints
  * @throws NumberFormatException if the range's values cannot be converted to {@code BigInteger}
  * @throws IllegalArgumentException if the range's values specify a nonsensical range
  */
 public void configure(InRange range) {
   if (!defaultValueOf(InRange.class, "min").equals(range.min()))
     min = new BigInteger(range.min());
   if (!defaultValueOf(InRange.class, "max").equals(range.max()))
     max = new BigInteger(range.max());
   if (min != null && max != null) checkRange("d", min, max);
 }
コード例 #2
0
 /**
  * Tells this generator to produce values within a specified {@linkplain InRange#min() minimum}
  * and/or {@linkplain InRange#max()} maximum}, inclusive, with uniform distribution.
  *
  * @param range annotation that gives the range's constraints
  */
 public void configure(InRange range) {
   if (!range.min().isEmpty()) min = Long.parseLong(range.min());
   if (!range.max().isEmpty()) max = Long.parseLong(range.max());
 }