Java Collection Intersect intersectInto(C into, Collection... from)

Here you can find the source of intersectInto(C into, Collection... from)

Description

intersect Into

License

Open Source License

Declaration

public static <T extends Object, C extends Collection<T>> C intersectInto(C into, Collection<T>... from) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {
    public static <T extends Object, C extends Collection<T>> C intersectInto(C into, Collection<T>... from) {
        if (from.length > 0) {
            into.addAll(from[0]);/*from   w  w  w  . ja  v  a2  s. co  m*/
            for (int i = 1; i < from.length; i++) {
                into.retainAll(from[i]);
            }
        }
        return into;
    }
}

Related

  1. intersect(Collection collA, Collection collB, Collection target)
  2. intersect(Collection collection1, Collection collection2)
  3. intersect(Collection t1, Collection t2)
  4. intersectCollections(Collection collection1, Collection collection2)
  5. intersectingCollections(Collection collection1, Collection collection2)
  6. intersection( Collection> coll)
  7. intersection(Collection a, Collection b)
  8. intersection(Collection> collectionOfCollections)
  9. intersection(Collection> availableValuesByDescriptor)