Java List Intersect intersect(Set a, List b)

Here you can find the source of intersect(Set a, List b)

Description

intersect

License

Apache License

Declaration

public static boolean intersect(Set<?> a, List<?> b) 

Method Source Code

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

import java.util.Collection;

import java.util.List;
import java.util.Set;

public class Main {
    public static boolean intersect(Set<?> a, List<?> b) {
        return intersect(a, (Iterable<?>) b);
    }//w w w .  j a  v  a2  s.com

    public static boolean intersect(Collection<?> a, Collection<?> b) {
        if (b.size() > a.size()) {
            Collection<?> c = a;
            a = b;
            b = c;
        }
        return intersect(a, (Iterable<?>) b);
    }

    public static boolean intersect(Collection<?> a, Iterable<?> iterable) {
        for (Object ele : iterable) {
            if (a.contains(ele))
                return true;
        }
        return false;
    }
}

Related

  1. intersect(List ls, List ls2)
  2. intersect(List lst1, List lst2)
  3. intersect(List list1, List list2)
  4. intersect(List... lists)
  5. intersect(List in1, List in2)
  6. intersect2orderedList(List s1, List s2)
  7. intersectAll(final List collector, final T[] a, final T[] b)
  8. intersectDate(List oDate, List tDate)
  9. intersection(final List list1, final List list2)