<commit_before>/*
 * This file is part of Gradoop.
 *
 * Gradoop is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gradoop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Gradoop. If not, see <http://www.gnu.org/licenses/>.
 */

package org.gradoop.model.impl.functions.bool;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.java.DataSet;

/**
 * Logical "NOT" as Flink function.
 */
public class Not implements MapFunction<Boolean, Boolean> {

  @Override
  public Boolean map(Boolean b) throws Exception {
    return !b;
  }

  public static DataSet<Boolean> map(DataSet<Boolean> b) {
    return b.map(new Not());
  }
}<commit_msg>method comment, #102<commit_after>/*
 * This file is part of Gradoop.
 *
 * Gradoop is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gradoop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Gradoop. If not, see <http://www.gnu.org/licenses/>.
 */

package org.gradoop.model.impl.functions.bool;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.java.DataSet;

/**
 * Logical "NOT" as Flink function.
 */
public class Not implements MapFunction<Boolean, Boolean> {

  @Override
  public Boolean map(Boolean b) throws Exception {
    return !b;
  }

  /**
   * Map a a boolean dataset to its inverse.
   *
   * @param b boolean dataset
   * @return inverse dataset
   */
  public static DataSet<Boolean> map(DataSet<Boolean> b) {
    return b.map(new Not());
  }
}
{'fraction_non_alphanumeric': 0.0887029288702929, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 3.633720930232558, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7489684', 'n_tokens_mistral': 679, 'n_tokens_neox': 661, 'n_words': 291}