<commit_before>/**
 *  Authors:  <NAME>
 *  Created: September, 2004
 *  Description:  This class represents a single generif.  It is based on code 
 *   previously called MedlineGrif and then later on a version that was in the
 *   GeneRIF Annotator source code.  
 *  Todo: having a public constructor seems weird.  For public consumers, these
 *  GeneRIFs should be 1) retrieved from a database and 2) immutable.
 *  Changes:
 *
 */

package edu.ucdenver.ccp.parser.ncbi.gene;

/**
 * Represents a GeneRIF object. A single GeneRIF object corresponds to a single line in the generifs_basic file downloadable from Entrez gene at:
 * ftp://ftp.ncbi.nlm.nih.gov/gene/GeneRIF/generifs_basic.gz
 * 
 * 
 */

import java.util.Date;

public class GeneRIF {

	private int id = -1;

	private final int taxID;

	private final int entrezID;

	private final int[] pmids;

	private final Date timeStamp;

	private final String text;

	public GeneRIF(int taxID, int entrezID, int[] pmids, Date timeStamp, String text) {
		this.taxID = taxID;
		this.entrezID = entrezID;
		this.pmids = pmids;
		this.timeStamp = timeStamp;
		this.text = text;
	}

	void setID(int id) {
		this.id = id;
	}

	public int getID() {
		return this.id;
	}

	public int getTaxID() {
		return this.taxID;
	}

	public int getEntrezID() {
		return entrezID;
	}

	public int[] getPMIDs() {
		return pmids;
	}

	public Date getTimeStamp() {
		return this.timeStamp;
	}

	public String getText() {
		return text;
	}

	public String toString() {
		return "GeneRIF: ID=" + id + "  Entrez ID=" + entrezID + "  Text=" + text;
	}

}<commit_msg>uses copies for mutable fields (in constructor and get methods). In response to FindBugs suggestion.<commit_after>/**
 *  Authors:  <NAME>
 *  Created: September, 2004
 *  Description:  This class represents a single generif.  It is based on code 
 *   previously called MedlineGrif and then later on a version that was in the
 *   GeneRIF Annotator source code.  
 *  Todo: having a public constructor seems weird.  For public consumers, these
 *  GeneRIFs should be 1) retrieved from a database and 2) immutable.
 *  Changes:
 *
 */

package edu.ucdenver.ccp.parser.ncbi.gene;

/**
 * Represents a GeneRIF object. A single GeneRIF object corresponds to a single line in the generifs_basic file downloadable from Entrez gene at:
 * ftp://ftp.ncbi.nlm.nih.gov/gene/GeneRIF/generifs_basic.gz
 * 
 * 
 */

import java.util.Arrays;
import java.util.Date;

public class GeneRIF {

	private int id = -1;

	private final int taxID;

	private final int entrezID;

	private final int[] pmids;

	private final Date timeStamp;

	private final String text;

	public GeneRIF(int taxID, int entrezID, int[] pmids, Date timeStamp, String text) {
		this.taxID = taxID;
		this.entrezID = entrezID;
		this.pmids = Arrays.copyOf(pmids, pmids.length);
		this.timeStamp = (Date) timeStamp.clone();
		this.text = text;
	}

	void setID(int id) {
		this.id = id;
	}

	public int getID() {
		return this.id;
	}

	public int getTaxID() {
		return this.taxID;
	}

	public int getEntrezID() {
		return entrezID;
	}

	public int[] getPMIDs() {
		return Arrays.copyOf(pmids, pmids.length);
	}

	public Date getTimeStamp() {
		return (Date) timeStamp.clone();
	}

	public String getText() {
		return text;
	}

	public String toString() {
		return "GeneRIF: ID=" + id + "  Entrez ID=" + entrezID + "  Text=" + text;
	}

}
{'fraction_non_alphanumeric': 0.103397341211226, 'fraction_numerical': 0.00413589364844904, 'mean_word_length': 3.3860103626943006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5211147', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1163, 'n_words': 380}