Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for safeGet (0.14 sec)

  1. android/guava/src/com/google/common/collect/Multimaps.java

        public Iterator<K> iterator() {
          return Maps.keyIterator(multimap.entries().iterator());
        }
    
        @Override
        public int count(@CheckForNull Object element) {
          Collection<V> values = Maps.safeGet(multimap.asMap(), element);
          return (values == null) ? 0 : values.size();
        }
    
        @Override
        public int remove(@CheckForNull Object element, int occurrences) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 86.4K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Maps.java

      }
    
      /**
       * Delegates to {@link Map#get}. Returns {@code null} on {@code ClassCastException} and {@code
       * NullPointerException}.
       */
      @CheckForNull
      static <V extends @Nullable Object> V safeGet(Map<?, V> map, @CheckForNull Object key) {
        checkNotNull(map);
        try {
          return map.get(key);
        } catch (ClassCastException | NullPointerException e) {
          return null;
        }
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 159.6K bytes
    - Viewed (0)
Back to top