- Sort Score
- Result 10 results
- Languages All
Results 111 - 120 of 173 for CAST (0.03 sec)
-
guava/src/com/google/common/hash/Striped64.java
Class<Unsafe> k = Unsafe.class; for (Field f : k.getDeclaredFields()) { f.setAccessible(true); Object x = f.get(null); if (k.isInstance(x)) return k.cast(x); } throw new NoSuchFieldError("the Unsafe"); } }); } catch (PrivilegedActionException e) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Jun 14 17:55:55 UTC 2024 - 11.5K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/RegularImmutableMap.java
@SuppressWarnings("unchecked") @Override @CheckForNull public V get(@CheckForNull Object key) { Object result = get(hashTable, alternatingKeysAndValues, size, 0, key); /* * We can't simply cast the result of `RegularImmutableMap.get` to V because of a bug in our * nullness checker (resulting from https://github.com/jspecify/checker-framework/issues/8). */ if (result == null) { return null;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Apr 15 22:32:14 UTC 2024 - 22.7K bytes - Viewed (0) -
android/guava/src/com/google/common/primitives/UnsignedInts.java
* value}. * * @param value any {@code long} value * @return {@code 2^32 - 1} if {@code value >= 2^32}, {@code 0} if {@code value <= 0}, and {@code * value} cast to {@code int} otherwise * @since 21.0 */ public static int saturatedCast(long value) { if (value <= 0) { return 0; } else if (value >= (1L << 32)) { return -1; } else {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 21:17:54 UTC 2024 - 13.7K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/LinkedHashMultimapTest.java
LinkedHashMultimap<String, Integer> multimap = LinkedHashMultimap.create(); for (int z = 1; z <= 100; z++) { multimap.put("a", z); // The Eclipse compiler (and hence GWT) rejects a parameterized cast. @SuppressWarnings("unchecked") LinkedHashMultimap<String, Integer>.ValueSet valueSet = (LinkedHashMultimap.ValueSet) multimap.backingMap().get("a"); assertEquals(z, valueSet.size());
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 18.6K bytes - Viewed (0) -
guava/src/com/google/common/primitives/UnsignedInts.java
* value}. * * @param value any {@code long} value * @return {@code 2^32 - 1} if {@code value >= 2^32}, {@code 0} if {@code value <= 0}, and {@code * value} cast to {@code int} otherwise * @since 21.0 */ public static int saturatedCast(long value) { if (value <= 0) { return 0; } else if (value >= (1L << 32)) { return -1; } else {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 21:17:54 UTC 2024 - 13.7K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/ImmutableSortedMap.java
// even though K doesn't explicitly implement Comparable. comparator = (Comparator<? super K>) NATURAL_ORDER; } if (map instanceof ImmutableSortedMap) { // TODO(kevinb): Prove that this cast is safe, even though // Collections.unmodifiableSortedMap requires the same key type. @SuppressWarnings("unchecked") ImmutableSortedMap<K, V> kvMap = (ImmutableSortedMap<K, V>) map;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Oct 30 16:15:19 UTC 2024 - 53K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/primitives/CharsTest.java
assertThat(Chars.saturatedCast(Long.MIN_VALUE)).isEqualTo(LEAST); } private void assertCastFails(long value) { try { Chars.checkedCast(value); fail("Cast to char should have failed: " + value); } catch (IllegalArgumentException ex) { assertWithMessage(value + " not found in exception text: " + ex.getMessage()) .that(ex.getMessage().contains(String.valueOf(value)))
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 02:56:12 UTC 2024 - 25.6K bytes - Viewed (0) -
android/guava/src/com/google/common/reflect/TypeResolver.java
return Types.newParameterizedTypeWithOwner( resolvedOwner, (Class<?>) resolvedRawType, resolvedArgs); } private static <T> T expectArgument(Class<T> type, Object arg) { try { return type.cast(arg); } catch (ClassCastException e) { throw new IllegalArgumentException(arg + " is not a " + type.getSimpleName()); } } /** A TypeTable maintains mapping from {@link TypeVariable} to types. */
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 10 19:45:10 UTC 2022 - 24.2K bytes - Viewed (0) -
guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java
monitor.enter(); try { if (a.length < count) a = ObjectArrays.newArray(a, count); int k = 0; int i = takeIndex; while (k < count) { // This cast is not itself safe, but the following statement // will fail if the runtime type of items[i] is not assignable // to the runtime type of a[k++], which is all that the method
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Apr 19 19:24:36 UTC 2023 - 22.5K bytes - Viewed (0) -
android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
for (Field f : k.getDeclaredFields()) { f.setAccessible(true); Object x = f.get(null); if (k.isInstance(x)) return k.cast(x); } throw new NoSuchFieldError("the Unsafe"); } }); } catch (PrivilegedActionException e) {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 20.5K bytes - Viewed (0)