Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for nextInt (0.15 sec)

  1. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java

          for (int i = 0; i < iterations; i++) {
            int keyIndex = random.nextInt(nKeys);
            String key = keys.get(keyIndex);
            Operation op = operations[random.nextInt(operations.length)];
            switch (op) {
              case ADD:
                {
                  int delta = random.nextInt(10);
                  multiset.add(key, delta);
                  deltas[keyIndex] += delta;
                  break;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

            double num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add((double) counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            double[] array = new double[RANDOM.nextInt(10)];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        for (int i = 0; i < heapSize; i++) {
          mmHeap.add(random.nextInt());
        }
        for (int i = 0; i < numberOfModifications; i++) {
          mmHeap.removeAt(random.nextInt(mmHeap.size()));
          assertIntactUsingSeed(seed, mmHeap);
          mmHeap.add(random.nextInt());
          assertIntactUsingSeed(seed, mmHeap);
        }
      }
    
      public void testRemoveAt_exhaustive() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java

            int num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add(counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableIntArray.Builder builder, AtomicInteger counter) {
            int[] array = new int[RANDOM.nextInt(10)];
            for (int i = 0; i < array.length; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

            double num = RANDOM.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add((double) counter.getAndIncrement());
            }
            builder.addAll(iterable(list));
          }
        },
        ADD_STREAM {
          @Override
          void doIt(ImmutableDoubleArray.Builder builder, AtomicInteger counter) {
            double[] array = new double[RANDOM.nextInt(10)];
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/collect/MinMaxPriorityQueueTest.java

        for (int i = 0; i < heapSize; i++) {
          mmHeap.add(random.nextInt());
        }
        for (int i = 0; i < numberOfModifications; i++) {
          mmHeap.removeAt(random.nextInt(mmHeap.size()));
          assertIntactUsingSeed(seed, mmHeap);
          mmHeap.add(random.nextInt());
          assertIntactUsingSeed(seed, mmHeap);
        }
      }
    
      public void testRemoveAt_exhaustive() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 35.9K bytes
    - Viewed (0)
  7. android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java

      void setUp() {
        checkArgument(size > 0, "empty collection not supported");
        Set<Integer> set = new LinkedHashSet<>(size);
    
        Random random = new Random();
        while (set.size() < size) {
          set.add(random.nextInt());
        }
        List<Integer> list = new ArrayList<>(set);
        inputOrder.arrange(list);
        input = ImmutableList.copyOf(list);
      }
    
      @Benchmark
      int collections(int reps) {
        int dummy = 0;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/CollectionBenchmarkSampleData.java

        Set<Element> set = Sets.newHashSetWithExpectedSize(size);
        while (set.size() < size) {
          set.add(newElement());
        }
        return set;
      }
    
      private Element newElement() {
        int value = random.nextInt();
        return isUserTypeFast ? new Element(value) : new SlowElement(value);
      }
    
      static class Element implements Comparable<Element> {
        final int hash;
    
        Element(int hash) {
          this.hash = hash;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. guava-tests/benchmark/com/google/common/collect/ComparatorDelegationOverheadBenchmark.java

      @BeforeExperiment
      void setUp() throws Exception {
        Random rng = new Random();
        for (int i = 0; i < 0x100; i++) {
          Integer[] array = new Integer[n];
          for (int j = 0; j < n; j++) {
            array[j] = rng.nextInt();
          }
          inputArrays[i] = array;
        }
      }
    
      @Benchmark
      int arraysSortNoComparator(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  10. guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java

      void setUp() {
        checkArgument(size > 0, "empty collection not supported");
        Set<Integer> set = new LinkedHashSet<>(size);
    
        Random random = new Random();
        while (set.size() < size) {
          set.add(random.nextInt());
        }
        List<Integer> list = new ArrayList<>(set);
        inputOrder.arrange(list);
        input = ImmutableList.copyOf(list);
      }
    
      @Benchmark
      int collections(int reps) {
        int dummy = 0;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3.5K bytes
    - Viewed (0)
Back to top