Package ar.edu.unlp.yaqc4j.generators.java.lang

Examples of ar.edu.unlp.yaqc4j.generators.java.lang.ByteGen


   * Initializes all basic known generators.
   */
  private static void initializeBasicGenerators() {
    // primitive types can be used because wrappers generator do not return
    // null values
    basicRegisterFor(new ByteGen(), Byte.class);
    basicRegisterFor(new ByteGen(), byte.class);
    basicRegisterFor(new ShortGen(), Short.class);
    basicRegisterFor(new ShortGen(), short.class);
    // basicRegisterFor(new IntegerGen(), Integer.class);
    // basicRegisterFor(new IntegerGen(), int.class);
    basicRegisterFor(new CharacterGen(), Character.class);
View Full Code Here


  /**
   * @{inheritDoc
   */
  public BigInteger arbitrary(final Distribution random, final long minsize,
      final long maxsize) {
    ByteGen gen = new ByteGen();
    byte[] bytes = new byte[new PositiveIntegerGen().arbitrary(random,
        minsize, Math.min(maxsize, 2000))]; // FIXME: arbitrary length of this array to avoid OutOfMemoryError
    for (int i = 0; i < bytes.length; i++) {
      bytes[i] = gen.arbitrary(random, minsize, maxsize);
    }
    return new BigInteger(new PositiveIntegerGen().arbitrary(random,
        minsize, maxsize) > 0 ? 1 : -1, bytes);
  }
View Full Code Here

TOP

Related Classes of ar.edu.unlp.yaqc4j.generators.java.lang.ByteGen

Copyright © 2018 www.massapicom. 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.