Exemplo n.º 1
0
 /**
  * Returns {@code true} if {@code iterable} contains any object for which {@code equals(element)}
  * is true.
  */
 public static boolean contains(Iterable<?> iterable, @Nullable Object element) {
   if (iterable instanceof Collection) {
     Collection<?> collection = (Collection<?>) iterable;
     return Collections2.safeContains(collection, element);
   }
   return Iterators.contains(iterable.iterator(), element);
 }
Exemplo n.º 2
0
 public boolean containsValue(Object paramObject) {
   if (paramObject == null) return false;
   return Iterators.contains(valueIterator(), paramObject);
 }
Exemplo n.º 3
0
 protected boolean standardContains(@Nullable Object var1) {
   return Iterators.contains(this.iterator(), var1);
 }
Exemplo n.º 4
0
 /**
  * A sensible definition of {@link #contains} in terms of {@link #iterator}. If you override
  * {@link #iterator}, you may wish to override {@link #contains} to forward to this
  * implementation.
  *
  * @since 7.0
  */
 protected boolean standardContains(@Nullable Object object) {
   return Iterators.contains(iterator(), object);
 }