Examples of RandomIndexGenerator


Examples of programming5.code.RandomIndexGenerator

    protected RandomIndexGenerator alphabeticMixedCaseRandom;
    protected Random lengthRandom;

    public RandomStringGenerator() {
        lengthRandom = new Random(System.currentTimeMillis());
        generalRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "32-126");   // TODO: What is a good code range for all?
        numericRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57");
        alphanumericRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57, 97-122");
        alphabeticRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "97 - 122");
        alphanumericMixedCaseRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57, 97-122, 65-90");
        alphabeticMixedCaseRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "65-90, 97-122");
    }
View Full Code Here

Examples of programming5.code.RandomIndexGenerator

    /**
     * @param seed seed for random number generators
     */
    public RandomStringGenerator(long seed) {
        lengthRandom = new Random(seed);
        generalRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "32-126");
        numericRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57");
        alphanumericRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57, 97-122");
        alphabeticRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "97 - 122");
        alphanumericMixedCaseRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "48-57, 97-122, 65-90");
        alphabeticMixedCaseRandom = new RandomIndexGenerator(lengthRandom.nextLong(), "65-90, 97-122");
    }
View Full Code Here

Examples of programming5.code.RandomIndexGenerator

        }
        int[][] aux = new int[ranges.length][];
        for (int i = 0; i < ranges.length; i++) {
            aux[i] = (int[]) ranges[i];
        }
        RandomIndexGenerator customRandom = new RandomIndexGenerator(lengthRandom.nextLong(), aux);
        // Generate string
        String ret = "";
        for (int i = 0; i < length; i++) {
            ret += Character.toString((char) customRandom.getRandomIndex());
        }
        return ret;
    }
View Full Code Here

Examples of programming5.code.RandomIndexGenerator

    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        df = new KeyboardCharDistanceFunction();
        RandomIndexGenerator rig = new RandomIndexGenerator("32-126");
        arbitrary1 = (char) rig.getRandomIndex();
        arbitrary2 = (char) rig.getRandomIndex();
        arbitrary3 = (char) rig.getRandomIndex();
    }
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.