<commit_before>package org.ndexbio.common.models.object;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.ndexbio.common.models.data.*;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Network extends MetadataObject
{
    private Map<String, Citation> _citations;
    private String _description;
    private int _edgeCount;
    private Map<String, Edge> _edges;
    private boolean _isLocked;
    private boolean _isPublic;
    private List<Membership> _members;
    private String _name;
    private Map<String, Namespace> _namespaces;
    private int _nodeCount;
    private Map<String, Node> _nodes;
    private List<Request> _requests;
    private Map<String, Support> _supports;
    private Map<String, Term> _terms;



    /**************************************************************************
    * Default constructor.
    **************************************************************************/
    public Network()
    {
        super();

        _isLocked = false;
        _isPublic = false;
        _edgeCount = 0;
        _nodeCount = 0;
        
        initCollections();
    }

    /**************************************************************************
    * Populates the class (from the database) and removes circular references.
    * Doesn't load Edges, Nodes, or Terms.
    * 
    * @param network The Network with source data.
    **************************************************************************/
    public Network(INetwork network)
    {
        this(network, false);
    }

    /**************************************************************************
    * Populates the class (from the database) and removes circular references.
    * 
    * @param network        The Network with source data.
    * @param loadEverything True to load Edges, Nodes, and Terms, false to
    *                       exclude them.
    **************************************************************************/
    public Network(INetwork network, boolean loadEverything)
    {
        super(network);

        this.initCollections();

        _description = network.getDescription();
        _edgeCount = network.getNdexEdgeCount();
        _isLocked = network.getIsLocked();
        _isPublic = network.getIsPublic();
        _nodeCount = network.getNdexNodeCount();
        _name = network.getName();
        
        for (final INetworkMembership member : network.getMembers())
        {
            if (member.getMember() instanceof IUser)
                _members.add(new Membership((IUser)member.getMember(), member.getPermissions()));
            else if (member.getMember() instanceof IGroup)
                _members.add(new Membership((IGroup)member.getMember(), member.getPermissions()));
        }
        
        for (final IRequest request : network.getRequests())
            _requests.add(new Request(request));

        if (loadEverything)
        {
            for (final IEdge edge : network.getNdexEdges())
                _edges.put(edge.getJdexId(), new Edge(edge));

            for (final INode node : network.getNdexNodes())
                _nodes.put(node.getJdexId(), new Node(node));

            for (final ITerm term : network.getTerms())
            {
                if (term instanceof IBaseTerm)
                    _terms.put(term.getJdexId(), new BaseTerm((IBaseTerm)term));
                else if (term instanceof IFunctionTerm)
                    _terms.put(term.getJdexId(), new FunctionTerm((IFunctionTerm)term));
            }

            for (final ICitation citation : network.getCitations())
                _citations.put(citation.getJdexId(), new Citation(citation));

            for (final INamespace namespace : network.getNamespaces())
                _namespaces.put(namespace.getJdexId(), new Namespace(namespace));

            for (final ISupport support : network.getSupports())
                _supports.put(support.getJdexId(), new Support(support));
        }
    }

    

    public Map<String, Citation> getCitations()
    {
        return _citations;
    }

    public void setCitations(Map<String, Citation> citations)
    {
        _citations = citations;
    }

    public String getDescription()
    {
        return _description;
    }
    
    public void setDescription(String description)
    {
        _description = description;
    }
    
    public int getEdgeCount()
    {
        return _edgeCount;
    }

    public void setEdgeCount(int edgeCount)
    {
        _edgeCount = edgeCount;
    }

    public Map<String, Edge> getEdges()
    {
        return _edges;
    }

    public void setEdges(Map<String, Edge> edges)
    {
        _edges = edges;
    }

    public boolean getIsLocked()
    {
        return _isLocked;
    }
    
    public void setIsLocked(boolean isLocked)
    {
        _isLocked = isLocked;
    }
    
    public boolean getIsPublic()<commit_msg>Added IsComplete property to network object model.<commit_after>package org.ndexbio.common.models.object;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.ndexbio.common.models.data.*;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Network extends MetadataObject
{
    private Map<String, Citation> _citations;
    private String _description;
    private int _edgeCount;
    private Map<String, Edge> _edges;
    private boolean _isComplete;
    private boolean _isLocked;
    private boolean _isPublic;
    private List<Membership> _members;
    private String _name;
    private Map<String, Namespace> _namespaces;
    private int _nodeCount;
    private Map<String, Node> _nodes;
    private List<Request> _requests;
    private Map<String, Support> _supports;
    private Map<String, Term> _terms;



    /**************************************************************************
    * Default constructor.
    **************************************************************************/
    public Network()
    {
        super();

        _isComplete = false;
        _isLocked = false;
        _isPublic = false;
        _edgeCount = 0;
        _nodeCount = 0;
        
        initCollections();
    }

    /**************************************************************************
    * Populates the class (from the database) and removes circular references.
    * Doesn't load Edges, Nodes, or Terms.
    * 
    * @param network The Network with source data.
    **************************************************************************/
    public Network(INetwork network)
    {
        this(network, false);
    }

    /**************************************************************************
    * Populates the class (from the database) and removes circular references.
    * 
    * @param network        The Network with source data.
    * @param loadEverything True to load Edges, Nodes, and Terms, false to
    *                       exclude them.
    **************************************************************************/
    public Network(INetwork network, boolean loadEverything)
    {
        super(network);

        this.initCollections();

        _description = network.getDescription();
        _edgeCount = network.getNdexEdgeCount();
        _isComplete = network.getIsComplete();
        _isLocked = network.getIsLocked();
        _isPublic = network.getIsPublic();
        _nodeCount = network.getNdexNodeCount();
        _name = network.getName();
        
        for (final INetworkMembership member : network.getMembers())
        {
            if (member.getMember() instanceof IUser)
                _members.add(new Membership((IUser)member.getMember(), member.getPermissions()));
            else if (member.getMember() instanceof IGroup)
                _members.add(new Membership((IGroup)member.getMember(), member.getPermissions()));
        }
        
        for (final IRequest request : network.getRequests())
            _requests.add(new Request(request));

        if (loadEverything)
        {
            for (final IEdge edge : network.getNdexEdges())
                _edges.put(edge.getJdexId(), new Edge(edge));

            for (final INode node : network.getNdexNodes())
                _nodes.put(node.getJdexId(), new Node(node));

            for (final ITerm term : network.getTerms())
            {
                if (term instanceof IBaseTerm)
                    _terms.put(term.getJdexId(), new BaseTerm((IBaseTerm)term));
                else if (term instanceof IFunctionTerm)
                    _terms.put(term.getJdexId(), new FunctionTerm((IFunctionTerm)term));
            }

            for (final ICitation citation : network.getCitations())
                _citations.put(citation.getJdexId(), new Citation(citation));

            for (final INamespace namespace : network.getNamespaces())
                _namespaces.put(namespace.getJdexId(), new Namespace(namespace));

            for (final ISupport support : network.getSupports())
                _supports.put(support.getJdexId(), new Support(support));
        }
    }

    

    public Map<String, Citation> getCitations()
    {
        return _citations;
    }

    public void setCitations(Map<String, Citation> citations)
    {
        _citations = citations;
    }

    public String getDescription()
    {
        return _description;
    }
    
    public void setDescription(String description)
    {
        _description = description;
    }
    
    public int getEdgeCount()
    {
        return _edgeCount;
    }

    public void setEdgeCount(int edgeCount)
    {
        _edgeCount = edgeCount;
    }

    public Map<String, Edge> getEdges()
    {
        return _edges;
    }

    public void setEdges(Map<String, Edge> edges)
    {
        _edges = edges;
    }

    public boolean getIsComplete()
    {
        return _isComplete;
    }
    
    public void setIsComplete(boolean isComplete)
    {
        _isComplete = isComplete;
    }

    public boolean getIsLocked()
    {
        return _isLocked;
    }
    
    public void setIsLocked(boolean isLocked)
    {
        _isLocked = isLocked;
    }
    
    public boolean getIsPublic()
{'fraction_non_alphanumeric': 0.16993337839142608, 'fraction_numerical': 0.0003862122236168775, 'mean_word_length': 2.537568306010929, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7318946', 'n_tokens_mistral': 2743, 'n_tokens_neox': 2611, 'n_words': 645}