Examples of nextInt()


Examples of java.util.Random.nextInt()

    public static void shuffle(final Object[] array) {
        final Random r = new Random();
        final int limit = array.length;
        for(int i = 0; i < limit; ++i) {
            swap(array, i, r.nextInt(limit));
        }
    }

    public static void shuffle(final int[] array) {
        final Random r = new Random();
View Full Code Here

Examples of java.util.Random.nextInt()

    public static void shuffle(final int[] array) {
        final Random r = new Random();
        final int limit = array.length;
        for(int i = 0; i < limit; ++i) {
            swap(array, i, r.nextInt(limit));
        }
    }

    public static void shuffle(final Object[] array, final long seed) {
        final Random r = new Random(seed);
View Full Code Here

Examples of java.util.Random.nextInt()

    public static void shuffle(final Object[] array, final long seed) {
        final Random r = new Random(seed);
        final int limit = array.length;
        for(int i = 0; i < limit; ++i) {
            swap(array, i, r.nextInt(limit));
        }
    }

    public static void swap(final Object[] array, final int i, final int j) {
        Object o = array[i];
View Full Code Here

Examples of java.util.Random.nextInt()

      //System.out.println(gc.getForeground().getRGB().toString());
      //System.out.println("paintItem " + gc.getClipping());
      if (TableViewSWTImpl.DEBUG_CELL_CHANGES) {
        Random random = new Random(SystemTime.getCurrentTime() / 500);
        gc.setBackground(ColorCache.getColor(gc.getDevice(),
            210 + random.nextInt(45), 210 + random.nextInt(45),
            210 + random.nextInt(45)));
        gc.fillRectangle(gc.getClipping());
      }

      if (item == null || item.isDisposed()) {
View Full Code Here

Examples of java.util.Random.nextInt()

      //System.out.println(gc.getForeground().getRGB().toString());
      //System.out.println("paintItem " + gc.getClipping());
      if (TableViewSWTImpl.DEBUG_CELL_CHANGES) {
        Random random = new Random(SystemTime.getCurrentTime() / 500);
        gc.setBackground(ColorCache.getColor(gc.getDevice(),
            210 + random.nextInt(45), 210 + random.nextInt(45),
            210 + random.nextInt(45)));
        gc.fillRectangle(gc.getClipping());
      }

      if (item == null || item.isDisposed()) {
View Full Code Here

Examples of java.util.Random.nextInt()

      //System.out.println("paintItem " + gc.getClipping());
      if (TableViewSWTImpl.DEBUG_CELL_CHANGES) {
        Random random = new Random(SystemTime.getCurrentTime() / 500);
        gc.setBackground(ColorCache.getColor(gc.getDevice(),
            210 + random.nextInt(45), 210 + random.nextInt(45),
            210 + random.nextInt(45)));
        gc.fillRectangle(gc.getClipping());
      }

      if (item == null || item.isDisposed()) {
        return;
View Full Code Here

Examples of java.util.Random.nextInt()

                System.out.println(getInfo());
            }
        };
        final Random rand = new Random(2390814071209731L);
        for(int i = 0; i < 100; i++) {
            Thread.sleep(rand.nextInt(3000));
            bar.inc();
        }
        bar.finish();
        System.err.println(bar.getInfo());
    }
View Full Code Here

Examples of java.util.Random.nextInt()

   
    Random  r = new Random();
   
    for (int i=0;i<10000;i++){
     
      int  len = r.nextInt(32);
     
      byte[]  x = new byte[len];
     
      r.nextBytes( x );
     
View Full Code Here

Examples of java.util.Random.nextInt()

        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(22222);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 1000; i++) {
                data.writeInt(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
View Full Code Here

Examples of java.util.Random.nextInt()

        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);
        DataOutputStream data = new DataOutputStream(out);
        Random rand = new Random(44444);
        for(int times = 0; times < 3; times++) {
            for(int i = 0; i < 10000; i++) {
                data.writeInt(rand.nextInt());
            }
            probe(out.toByteArray_clear());
        }
    }
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.