<commit_before>/**********************************************************************
Copyright (c) 2009-2011 <NAME>. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 ***********************************************************************/

package net.sf.kerner.utils.collections;

/**
 * 
 * Simple class to invert the filtering logic of another {@link Filter}.
 * 
 * <p>
 * <b>Example:</b><br>
 *
 * </p>
 * <p>
 * <pre>
 * TODO example
 * </pre>
 * </p>
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version 2011-10-26
 * 
 * @see Filter
 *
 * @param <E> type of elements which are filtered
 */
public class FilterInverter<E> implements Filter<E>{
	
	private final Filter<E> filter;
	
	public FilterInverter(Filter<E> filter) {
		super();
		this.filter = filter;
	}

	public Boolean visit(E element) {<commit_msg>FilterInverter: Add check for null object.<commit_after>/**********************************************************************
Copyright (c) 2009-2011 <NAME>. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 ***********************************************************************/

package net.sf.kerner.utils.collections;

import net.sf.kerner.utils.Utils;

/**
 * 
 * Simple class to invert the filtering logic of another {@link Filter}.
 * 
 * <p>
 * <b>Example:</b><br>
 *
 * </p>
 * <p>
 * <pre>
 * TODO example
 * </pre>
 * </p>
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @version 2011-10-26
 * 
 * @see Filter
 *
 * @param <E> type of elements which are filtered
 */
public class FilterInverter<E> implements Filter<E>{
	
	private final Filter<E> filter;
	
	public FilterInverter(Filter<E> filter) {
		super();
		Utils.checkForNull(filter);
		this.filter = filter;
	}

	public Boolean visit(E element) {
{'fraction_non_alphanumeric': 0.20605397520058352, 'fraction_numerical': 0.014587892049598834, 'mean_word_length': 4.42094861660079, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6079004', 'n_tokens_mistral': 812, 'n_tokens_neox': 736, 'n_words': 292}