Java Set Search contains(Set setTocheck, Set mustHaveAllThese)

Here you can find the source of contains(Set setTocheck, Set mustHaveAllThese)

Description

contains

License

Apache License

Declaration

public static boolean contains(Set<String> setTocheck, Set<String> mustHaveAllThese) 

Method Source Code


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

import java.util.*;

public class Main {
    public static boolean contains(Set<String> setTocheck, Set<String> mustHaveAllThese) {

        for (String s : mustHaveAllThese) {//iterate over all must have tags.
            if (!setTocheck.contains(s)) {//return immediately when item not found in setToCheck
                return false;
            }//www.ja  va2  s.  c  o m
        }
        return true;
    }
}

Related

  1. contains(BitSet x, BitSet y)
  2. Contains(Set s, Object o)
  3. containsAny(Set container, Set possibilities)
  4. containsCaseInsensitive(String s, Set l)
  5. containsSome(Set one, Set two)