Here you can find the source of containsNo(Collection
Parameter | Description |
---|---|
T | Type of collection elements |
baseList | List to check for occurrences |
valueList | Values to search |
true
if baseList
contains any element of valueList
; false
otherwise
public static <T> boolean containsNo(Collection<T> baseList, Collection<T> valueList)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from w w w . jav a2 s. com*/ * Checks if the given basic list contains any element of the given value * list. * * @param <T> * Type of collection elements * @param baseList * List to check for occurrences * @param valueList * Values to search * @return <code>true</code> if <code>baseList</code> contains any element * of <code>valueList</code>; <code>false</code> otherwise */ public static <T> boolean containsNo(Collection<T> baseList, Collection<T> valueList) { for (T v : valueList) { if (baseList.contains(v)) { return false; } } return true; } }