Examples of IntegerGenerator


Examples of net.java.quickcheck.generator.support.IntegerGenerator

   * @param high
   *            max size
   */
  public static <T> Generator<List<T>> lists(Generator<? extends T> content, int low,
      int high) {
    return lists(content, new IntegerGenerator(low, high));
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

  /**
   * Create a new string generator which generates strings of characters from
   * the given string with a length between min and max.
   */
  public static ExtendibleGenerator<Character, String> strings(String allowedCharacters, int min, int max) {
    return new StringGenerator(new IntegerGenerator(min, max), characters(allowedCharacters));
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

   *            lower size boundary
   * @param max
   *            upper size boundary
   */
  public static ExtendibleGenerator<Character, String> strings(int min, int max) {
    return new StringGenerator(new IntegerGenerator(min, max), new CharacterGenerator());
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

  /**
   * Create a new string generator which creates strings with sizes ranging
   * from loLengh to hiLength of characters from a-z and A-Z.
   */
  public static ExtendibleGenerator<Character, String> letterStrings(int min, int max) {
    StringGenerator generator = new StringGenerator(new IntegerGenerator(min, max), characters('a', 'z'));
    return generator.add(characters('A', 'Z'));
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

   * Create a new integer generator which creates integers ranging from
   * {@link Integer#MIN_VALUE} to {@link Integer#MAX_VALUE}.
   *
   */
  public static Generator<Integer> integers() {
    return new IntegerGenerator();
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

  /**
   * Create a new integer generator which creates integers that are at equal
   * or greater than low.
   */
  public static Generator<Integer> integers(int low) {
    return new IntegerGenerator(low, Integer.MAX_VALUE);
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

  /**
   * Create a new integer generator which creates integers ranging from lo to
   * hi.
   */
  public static Generator<Integer> integers(int lo, int hi) {
    return new IntegerGenerator(lo, hi);
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

   * Create a new integer generator which creates integers ranging from lo to
   * hi based on the given {@link Distribution}.
   */
  public static Generator<Integer> integers(int lo, int hi,
      Distribution distribution) {
    return new IntegerGenerator(lo, hi, distribution);
  }
View Full Code Here

Examples of net.java.quickcheck.generator.support.IntegerGenerator

  /**
   * Create a new integer generator which creates positive integers than are
   * equal or smaller than high.
   */
  public static Generator<Integer> positiveIntegers(int high) {
    return new IntegerGenerator(1, high);
  }
View Full Code Here

Examples of voldemort.performance.benchmark.generator.IntegerGenerator

        int opCount = props.getInt(Benchmark.OPS_COUNT);

        Class<?> keyTypeClass = getKeyTypeClass(keyType);
        int insertStart = props.getInt(Benchmark.START_KEY_INDEX, 0);

        IntegerGenerator warmUpKeySequence = new CounterGenerator(insertStart);
        this.warmUpKeyProvider = getKeyProvider(keyTypeClass, warmUpKeySequence, 0);

        this.transformsChooser = null;
        if(hasTransforms) {
            this.transformsChooser = new DiscreteGenerator();
            List<String> transforms = BenchmarkViews.getTransforms();
            for(String transform: transforms) {
                this.transformsChooser.addValue(1.0, transform);
            }
        }

        operationChooser = new DiscreteGenerator();
        if(readProportion > 0) {
            operationChooser.addValue(readProportion, Benchmark.READS);
        }
        if(mixedProportion > 0) {
            operationChooser.addValue(mixedProportion, Benchmark.MIXED);
        }
        if(writeProportion > 0) {
            operationChooser.addValue(writeProportion, Benchmark.WRITES);
        }
        if(deleteProportion > 0) {
            operationChooser.addValue(deleteProportion, Benchmark.DELETES);
        }

        CounterGenerator insertKeySequence = null;
        if(recordCount > 0) {
            insertKeySequence = new CounterGenerator(recordCount);
        } else {
            Random randomizer = new Random();
            insertKeySequence = new CounterGenerator(randomizer.nextInt(Integer.MAX_VALUE));

        }

        IntegerGenerator keyGenerator = null;
        if(recordSelection.compareTo(Benchmark.UNIFORM_RECORD_SELECTION) == 0) {

            int keySpace = (recordCount > 0) ? recordCount : Integer.MAX_VALUE;
            keyGenerator = new UniformIntegerGenerator(0, keySpace - 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.