Java Collection Contain containsInstance(Collection collection, Object element)

Here you can find the source of containsInstance(Collection collection, Object element)

Description

contains Instance

License

Apache License

Declaration

public static boolean containsInstance(Collection collection, Object element) 

Method Source Code

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

import java.util.Collection;

import java.util.Iterator;

public class Main {
    public static boolean containsInstance(Collection collection, Object element) {
        if (collection != null) {
            Iterator i$ = collection.iterator();

            while (i$.hasNext()) {
                Object candidate = i$.next();
                if (candidate == element) {
                    return true;
                }/*from   w  ww  .ja  va 2 s.co m*/
            }
        }

        return false;
    }
}

Related

  1. containsIgnoreCase(Collection collection, String testString)
  2. containsIgnoreCase(Collection collection, String value)
  3. containsIgnoreCase(Collection l, String s)
  4. containsIgnoreCase(String searchedWord, Collection words)
  5. containsIgnoreCase4Collections(Collection c, String s)
  6. containsInstance(Collection collection, Object element)
  7. containsInstanceOf(Collection collection, Class c)
  8. containsKey(Collection keys, String key)
  9. containsNo(Collection baseList, Collection valueList)