Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for safeContains (0.25 sec)

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

      }
    
      /**
       * Delegates to {@link Collection#contains}. Returns {@code false} if the {@code contains} method
       * throws a {@code ClassCastException} or {@code NullPointerException}.
       */
      static boolean safeContains(Collection<?> collection, @CheckForNull Object object) {
        checkNotNull(collection);
        try {
          return collection.contains(object);
        } catch (ClassCastException | NullPointerException e) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 22.8K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/Collections2.java

      }
    
      /**
       * Delegates to {@link Collection#contains}. Returns {@code false} if the {@code contains} method
       * throws a {@code ClassCastException} or {@code NullPointerException}.
       */
      static boolean safeContains(Collection<?> collection, @CheckForNull Object object) {
        checkNotNull(collection);
        try {
          return collection.contains(object);
        } catch (ClassCastException | NullPointerException e) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 23.1K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/ConcurrentHashMultiset.java

          @Override
          protected Set<E> delegate() {
            return delegate;
          }
    
          @Override
          public boolean contains(@CheckForNull Object object) {
            return object != null && Collections2.safeContains(delegate, object);
          }
    
          @Override
          public boolean containsAll(Collection<?> collection) {
            return standardContainsAll(collection);
          }
    
          @Override
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

          @Override
          protected Set<E> delegate() {
            return delegate;
          }
    
          @Override
          public boolean contains(@CheckForNull Object object) {
            return object != null && Collections2.safeContains(delegate, object);
          }
    
          @Override
          public boolean containsAll(Collection<?> collection) {
            return standardContainsAll(collection);
          }
    
          @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/StandardTable.java

            if (obj instanceof Entry) {
              Entry<?, ?> entry = (Entry<?, ?>) obj;
              return entry.getKey() != null
                  && entry.getValue() instanceof Map
                  && Collections2.safeContains(backingMap.entrySet(), entry);
            }
            return false;
          }
    
          @Override
          public boolean remove(@CheckForNull Object obj) {
            if (obj instanceof Entry) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Oct 13 14:11:58 GMT 2023
    - 29.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java

          }
    
          // The following methods are included for performance.
    
          @Override
          public boolean contains(@CheckForNull Object o) {
            return Collections2.safeContains(submap.entrySet(), o);
          }
    
          @Override
          public boolean remove(@CheckForNull Object o) {
            if (!contains(o)) {
              return false;
            }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Oct 13 14:11:58 GMT 2023
    - 46.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/AbstractMapBasedMultimap.java

          }
    
          // The following methods are included for performance.
    
          @Override
          public boolean contains(@CheckForNull Object o) {
            return Collections2.safeContains(submap.entrySet(), o);
          }
    
          @Override
          public boolean remove(@CheckForNull Object o) {
            if (!contains(o)) {
              return false;
            }
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Fri Oct 13 14:11:58 GMT 2023
    - 48K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Iterables.java

          Iterable<? extends @Nullable Object> iterable, @CheckForNull Object element) {
        if (iterable instanceof Collection) {
          Collection<?> collection = (Collection<?>) iterable;
          return Collections2.safeContains(collection, element);
        }
        return Iterators.contains(iterable.iterator(), element);
      }
    
      /**
       * Removes, from an iterable, every element that belongs to the provided collection.
       *
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 42.5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/Iterables.java

          Iterable<? extends @Nullable Object> iterable, @CheckForNull Object element) {
        if (iterable instanceof Collection) {
          Collection<?> collection = (Collection<?>) iterable;
          return Collections2.safeContains(collection, element);
        }
        return Iterators.contains(iterable.iterator(), element);
      }
    
      /**
       * Removes, from an iterable, every element that belongs to the provided collection.
       *
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 24 19:38:27 GMT 2024
    - 42.8K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/Maps.java

        public boolean containsKey(@CheckForNull Object key) {
          return backingSet().contains(key);
        }
    
        @Override
        @CheckForNull
        public V get(@CheckForNull Object key) {
          if (Collections2.safeContains(backingSet(), key)) {
            @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it
            K k = (K) key;
            return function.apply(k);
          } else {
            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