Java Collection Intersect intersect(Collection collection, Collection otherCollection)

Here you can find the source of intersect(Collection collection, Collection otherCollection)

Description

intersect

License

Open Source License

Declaration

protected static boolean intersect(Collection<?> collection, Collection<?> otherCollection) 

Method Source Code

//package com.java2s;
/*/*from   w  w  w .ja  v a2 s .  c om*/
 * Copyright (c) 2005, 2014 IBM Corporation, Embarcadero Technologies, CEA, and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - initial API and implementation
 *   Kenn Hussey (Embarcadero Technologies) - 204200, 247980
 *   Keith Campbell (IBM) - 343783
 *   Kenn Hussey (CEA) - 316165, 322715, 212765, 421756, 424568
 *   Christian W. Damus (CEA) - 405065
 *
 */

import java.util.Collection;
import java.util.Collections;

public class Main {
    protected static boolean intersect(Collection<?> collection, Collection<?> otherCollection) {
        return !Collections.disjoint(collection, otherCollection);
    }
}

Related

  1. hasIntersection(Collection c1, Collection c2)
  2. hasIntersection(Collection col1, Collection col2)
  3. hasIntersection(final Collection a, final Collection b)
  4. intersect(Collection c1, Collection c2)
  5. intersect(Collection c1, Collection c2)
  6. intersect(Collection... collections)
  7. intersect(Collection a, Collection b)
  8. intersect(Collection collA, Collection collB, Collection target)
  9. intersect(Collection collection1, Collection collection2)