<commit_before>/*
 * Grapht, an open source dependency injector.
 * Copyright 2010-2012 Regents of the University of Minnesota and contributors
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of the
 * License, or (at your option) any later version.
 *
 * This program 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
 * this program; if not, write to the Free Software Foundation, Inc., 51
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package org.grouplens.grapht.graph;

import org.grouplens.grapht.spi.CachedSatisfaction;
import org.grouplens.grapht.spi.Desire;

import javax.annotation.Nullable;
import java.io.Serializable;
import java.util.*;


/**
 * Graph is a utility class for composing Nodes and Edges into a usable graph,
 * using Edges to track the dependency relationships between nodes. It is a
 * fully mutable "collection" that provides methods to add, remove, and replace
 * nodes and edges. It assumes that all input nodes and edges are not null and
 * will throw exceptions otherwise. Graph is not thread safe.
 * 
 * @author <NAME> <<EMAIL>>
 */
public class Graph implements Serializable, Cloneable {
    private static final long serialVersionUID = 1L;
    
    // The outgoing key set is used to represent the set of nodes in the graph,
    // although it should hold that the incoming key set is equivalent
    private Map<Node, Set<Edge>> outgoing; // edge.head == key<commit_msg>Add review comment to `Graph`<commit_after>/*
 * Grapht, an open source dependency injector.
 * Copyright 2010-2012 Regents of the University of Minnesota and contributors
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of the
 * License, or (at your option) any later version.
 *
 * This program 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
 * this program; if not, write to the Free Software Foundation, Inc., 51
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
package org.grouplens.grapht.graph;

import org.grouplens.grapht.spi.CachedSatisfaction;
import org.grouplens.grapht.spi.Desire;

import javax.annotation.Nullable;
import java.io.Serializable;
import java.util.*;


/**
 * Graph is a utility class for composing Nodes and Edges into a usable graph,
 * using Edges to track the dependency relationships between nodes. It is a
 * fully mutable "collection" that provides methods to add, remove, and replace
 * nodes and edges. It assumes that all input nodes and edges are not null and
 * will throw exceptions otherwise. Graph is not thread safe.
 * 
 * @author <NAME> <<EMAIL>>
 */
public class Graph implements Serializable, Cloneable {
    private static final long serialVersionUID = 1L;
    
    // The outgoing key set is used to represent the set of nodes in the graph,
    // although it should hold that the incoming key set is equivalent
    private Map<Node, Set<Edge>> outgoing; // edge.head == key
    // REVIEW Do we need to serialze both edges, or should we reconstruct one from the other?
{'fraction_non_alphanumeric': 0.06519453207150368, 'fraction_numerical': 0.011566771819137749, 'mean_word_length': 3.890745501285347, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6535514', 'n_tokens_mistral': 1013, 'n_tokens_neox': 961, 'n_words': 521}