Here you can find the source of removeItems(List
Parameter | Description |
---|---|
T | a parameter |
list | a parameter |
remove | a parameter |
public static <T> List<T> removeItems(List<T> list, T... remove)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; public class Main { /**/*from w w w .j a v a 2 s . c o m*/ * Removes items from a list and returns that same list. This will modify * the list passed in! * * @param <T> * @param list * @param remove * @return */ public static <T> List<T> removeItems(List<T> list, T... remove) { if (isEmpty(list)) return null; list.removeAll(Arrays.asList(remove)); return list; } public static boolean isEmpty(Iterable<?> i) { if (i instanceof Collection) return ((Collection<?>) i).isEmpty(); return i == null || !i.iterator().hasNext(); } public static boolean isEmpty(Map<?, ?> p_oCol) { return p_oCol == null || p_oCol.isEmpty(); } }