Java Collection Contain contains(Collection collection, T item)

Here you can find the source of contains(Collection collection, T item)

Description

Checks if the given collection contains the specified item.

License

Apache License

Parameter

Parameter Description
collection collection to look in
item item to look for

Return

true if the item was found

Declaration

public static <T> boolean contains(Collection<T> collection, T item) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    /**//from  w ww  . j a  va 2 s . co  m
     * Checks if the given collection contains the specified item.
     * 
     * @param collection collection to look in
     * @param item item to look for
     * @return <tt>true</tt> if the item was found
     */
    public static <T> boolean contains(Collection<T> collection, T item) {
        return collection.contains(item);
    }
}

Related

  1. contains(Collection collection, A value)
  2. contains(Collection objectArray, Object element)
  3. contains(Collection container, String strSearch)
  4. contains(Collection mainCollection, String str)
  5. contains(Collection c1, Collection c2)
  6. contains(final Collection mimeTypes, final MimeType mimeType)
  7. contains(final Collection c, final T o)
  8. contains(Object o, Collection c)
  9. containsAll(Collection c, Iterable subset)

  10. HOME | Copyright © www.java2s.com 2016