1 package org.simantics.scl.compiler.environment.filter;
3 import gnu.trove.set.hash.THashSet;
5 public class NegativeNamespaceFilter implements NamespaceFilter {
6 THashSet<String> excludedValues;
8 public NegativeNamespaceFilter(THashSet<String> excludedValues) {
9 this.excludedValues = excludedValues;
13 public boolean isValueIncluded(String name) {
14 return !excludedValues.contains(name);
18 public String toString() {
19 return "Exclude" + excludedValues.toString();
23 public boolean isSubsetOf(NamespaceFilter filter) {
24 if(filter == AcceptAllNamespaceFilter.INSTANCE)
26 if(filter instanceof NegativeNamespaceFilter) {
27 NegativeNamespaceFilter other = (NegativeNamespaceFilter)filter;
28 for(String name : other.excludedValues)
29 if(!excludedValues.contains(name))