- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 139 for nextInt (0.29 sec)
-
guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java
char[] array = Chars.toArray(chars); this.testString = new String(array); } private char randomAlpha() { return ALPHA.charAt(random.nextInt(ALPHA.length())); } private char randomNonAlpha() { return NONALPHA.charAt(random.nextInt(NONALPHA.length())); } @Benchmark int asciiStringToUpperCase(int reps) { String string = noWorkToDo ? Ascii.toUpperCase(testString) : testString;
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Mon Dec 04 17:37:03 GMT 2017 - 4.8K bytes - Viewed (0) -
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++;
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Tue Feb 13 14:28:25 GMT 2024 - 4.2K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/collect/ConcurrentHashMultisetBenchmark.java
Random random = new Random(); int nKeys = keys.size(); long blah = 0; for (int i = 0; i < reps; i++) { Integer key = keys.get(random.nextInt(nKeys)); int delta = random.nextInt(5); blah += delta; multiset.add(key, delta); } return blah; } private long runAddRemoveSingleThread(int reps) { Random random = new Random();
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Wed May 09 15:17:25 GMT 2018 - 16.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java
for (int trials = 10; trials-- > 0; ) { byte[] left = new byte[1 + rnd.nextInt(32)]; rnd.nextBytes(left); byte[] right = left.clone(); assertThat(comparator.compare(left, right)).isEqualTo(0); int i = rnd.nextInt(left.length); left[i] ^= (byte) (1 + rnd.nextInt(255)); assertThat(comparator.compare(left, right)).isNotEqualTo(0);
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Tue Feb 20 17:00:05 GMT 2024 - 13.4K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java
char[] array = Chars.toArray(chars); this.testString = new String(array); } private char randomAlpha() { return ALPHA.charAt(random.nextInt(ALPHA.length())); } private char randomNonAlpha() { return NONALPHA.charAt(random.nextInt(NONALPHA.length())); } @Benchmark int asciiStringToUpperCase(int reps) { String string = noWorkToDo ? Ascii.toUpperCase(testString) : testString;
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Mon Dec 04 17:37:03 GMT 2017 - 4.8K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java
public void testEncodedStringInputs() { Random rng = new Random(0); for (int z = 0; z < 100; z++) { String str; int[] codePoints = new int[rng.nextInt(8)]; for (int i = 0; i < codePoints.length; i++) { do { codePoints[i] = rng.nextInt(0x800); } while (!Character.isValidCodePoint(codePoints[i]) || (codePoints[i] >= Character.MIN_SURROGATE
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 08 13:56:22 GMT 2021 - 8.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/io/ByteSourceTester.java
// if expected.length == 0, off has to be 0 but length doesn't matter--result will be empty int off = expected.length == 0 ? 0 : random.nextInt(expected.length); int len = expected.length == 0 ? 4 : random.nextInt(expected.length - off); ByteSourceFactory sliced = SourceSinkFactories.asSlicedByteSourceFactory(factory, off, len);
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 8.6K bytes - Viewed (0) -
src/main/java/org/codelibs/core/net/UuidUtil.java
buf.append(BASE); final int lowTime = (int) (System.currentTimeMillis() >> 32); StringUtil.appendHex(buf, lowTime); StringUtil.appendHex(buf, RANDOM.nextInt()); return buf.toString(); } private static byte[] getAddress() { try { return InetAddress.getLocalHost().getAddress(); } catch (final UnknownHostException ignore) {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 1.8K bytes - Viewed (0) -
guava-tests/test/com/google/common/io/RandomAmountInputStream.java
super(checkNotNull(in)); this.random = checkNotNull(random); } @Override public int read(byte[] b, int off, int len) throws IOException { return super.read(b, off, random.nextInt(len) + 1); }
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Mon Dec 04 17:37:03 GMT 2017 - 1.2K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/collect/HashMultisetAddPresentBenchmark.java
multisets.clear(); for (int i = 0; i < ARRAY_SIZE; i++) { HashMultiset<Integer> multiset = HashMultiset.<Integer>create(); multisets.add(multiset); queries[i] = random.nextInt(); multiset.add(queries[i]); } } @Benchmark int add(int reps) { int tmp = 0; for (int i = 0; i < reps; i++) { int j = i & ARRAY_MASK;
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Mon Dec 04 17:37:03 GMT 2017 - 1.6K bytes - Viewed (0)