Java Iterable Contain iterableContains(Iterable itrbl, E elem)

Here you can find the source of iterableContains(Iterable itrbl, E elem)

Description

Checks whether itrbl contains the element elem.

License

BSD License

Declaration

public static <E> boolean iterableContains(Iterable<E> itrbl, E elem) 

Method Source Code

//package com.java2s;
// Licensed under the Modified BSD Licence; see COPYING for details.

public class Main {
    /** Checks whether <code>itrbl</code> contains the element
    <code>elem</code>. */
    public static <E> boolean iterableContains(Iterable<E> itrbl, E elem) {
        for (E e : itrbl) {
            if (e.equals(elem))
                return true;
        }//from w w  w .ja v  a2  s  .  c om
        return false;
    }
}

Related

  1. iterableContains(Iterable iterable, O element)