Java Collection Contain containsAny(Collection set, Iterable elements)

Here you can find the source of containsAny(Collection set, Iterable elements)

Description

contains Any

License

Open Source License

Parameter

Parameter Description
elements a parameter

Declaration

public static boolean containsAny(Collection<Integer> set, Iterable<Integer> elements) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Caleydo - Visualization for Molecular Biology - http://caleydo.org
 * Copyright (c) The Caleydo Team. All rights reserved.
 * Licensed under the new BSD license, available at http://caleydo.org/license
 *******************************************************************************/

import java.util.Collection;

public class Main {
    /**//from www .j  a  v  a2 s  .c  o  m
     * @param elements
     * @return
     */
    public static boolean containsAny(Collection<Integer> set, Iterable<Integer> elements) {
        if (set == null)
            return false;
        for (Integer elem : elements)
            if (set.contains(elem))
                return true;
        return false;
    }
}

Related

  1. containsAny(Collection col1, Collection col2)
  2. containsAny(Collection source, Collection candidates)
  3. containsAny(Collection source, Object... candidates)
  4. containsAny(Collection collection1, Collection collection2)
  5. containsAny(Collection c1, Collection c2)
  6. containsAny(Collection c, String... toCheck)
  7. containsAny(Collection strs, Collection searchTerms)
  8. containsAny(Collection collection, Collection query)
  9. containsAny(Collection collection, Collection toCheck)