Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 92 for nextInt (0.04 sec)

  1. android/guava-tests/test/com/google/common/graph/GraphMutationTest.java

          assertThat(graph.nodes()).isEmpty();
          assertThat(graph.edges()).isEmpty();
          AbstractGraphTest.validateGraph(graph);
    
          while (graph.nodes().size() < NUM_NODES) {
            graph.addNode(gen.nextInt(NODE_POOL_SIZE));
          }
          ArrayList<Integer> nodeList = new ArrayList<>(graph.nodes());
          while (graph.edges().size() < NUM_EDGES) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 4.2K bytes
    - Viewed (0)
  2. android/guava-tests/benchmark/com/google/common/math/BigIntegerMathBenchmark.java

      int factorialBound;
    
      @BeforeExperiment
      void setUp() {
        for (int i = 0; i < ARRAY_SIZE; i++) {
          factorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
          slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound);
          binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1);
        }
      }
    
      /** Previous version of BigIntegerMath.factorial, kept for timing purposes. */
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 3.5K 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: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 36K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java

            long num = random.nextInt(10);
            for (int i = 0; i < num; i++) {
              list.add(counter.getAndIncrement());
            }
            builder.addAll(list);
          }
        },
        ADD_ITERABLE {
          @Override
          void doIt(ImmutableLongArray.Builder builder, AtomicLong counter) {
            List<Long> list = new ArrayList<>();
            long num = random.nextInt(10);
            for (int i = 0; i < num; i++) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 20.5K bytes
    - Viewed (0)
  5. android/guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java

          result[i] = allMatchingChars.charAt(random.nextInt(allMatchingChars.length()));
        }
        // Replace some of chars by non-matching.
        int remaining = (int) ((100 - percentMatching) * result.length / 100.0 + 0.5);
        while (remaining > 0) {
          char c = (char) random.nextInt();
          if (bitSet.get(c)) {
            int pos = random.nextInt(result.length);
            if (bitSet.get(result[pos])) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 3.9K bytes
    - Viewed (0)
  6. android/guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java

                  new BinaryNode(
                      rng.nextInt(), createTree(leftChildSize, rng), createTree(rightChildSize, rng)));
            }
          }
        },
        ALL_LEFT {
          @Override
          Optional<BinaryNode> createTree(int size, Random rng) {
            Optional<BinaryNode> root = Optional.absent();
            for (int i = 0; i < size; i++) {
              root = Optional.of(new BinaryNode(rng.nextInt(), root, Optional.<BinaryNode>absent()));
            }
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 4.9K bytes
    - Viewed (0)
  7. android/guava-tests/benchmark/com/google/common/collect/MultisetIteratorBenchmark.java

        // TODO(kevinb): generate better test contents for multisets
        while (sizeRemaining > 0) {
          // The JVM will return interned values for small ints.
          Integer value = random.nextInt(1000) + 128;
          int count = min(random.nextInt(10) + 1, sizeRemaining);
          sizeRemaining -= count;
          hashMultiset.add(value, count);
          linkedHashMultiset.add(value, count);
          treeMultiset.add(value, count);
        }
    
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 2.7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java

                    public Long call() {
                      long threadSum = 0;
                      for (int j = 0; j < getsPerTask; j++) {
                        long delta = random.nextInt(deltaRange);
                        int behavior = random.nextInt(10);
                        switch (behavior) {
                          case 0:
                            map.incrementAndGet(key);
                            threadSum++;
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 4.2K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/graph/NetworkMutationTest.java

          assertThat(network.nodes()).isEmpty();
          assertThat(network.edges()).isEmpty();
          AbstractNetworkTest.validateNetwork(network);
    
          while (network.nodes().size() < NUM_NODES) {
            network.addNode(gen.nextInt(NODE_POOL_SIZE));
          }
          ArrayList<Integer> nodeList = new ArrayList<>(network.nodes());
          for (int i = 0; i < NUM_EDGES; ++i) {
            // Parallel edges are allowed, so this should always succeed.
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 4.6K bytes
    - Viewed (0)
  10. guava-tests/benchmark/com/google/common/collect/BinaryTreeTraverserBenchmark.java

                  new BinaryNode(
                      rng.nextInt(), createTree(leftChildSize, rng), createTree(rightChildSize, rng)));
            }
          }
        },
        ALL_LEFT {
          @Override
          Optional<BinaryNode> createTree(int size, Random rng) {
            Optional<BinaryNode> root = Optional.absent();
            for (int i = 0; i < size; i++) {
              root = Optional.of(new BinaryNode(rng.nextInt(), root, Optional.<BinaryNode>absent()));
            }
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-19 18:03
    - 4.9K bytes
    - Viewed (0)
Back to top