<commit_before>package com.wtsintegration.adsi.model;

import java.util.*;

/**
 * Calls used to represent the presentation data model. It consists of an ArrayList
 * of PresentationDataRow objects, each of which is a HashMap, that contains a set of keys
 * and corresponding values. i.e. drugs="LETAIRIS, ADCIRCA, REMODULIN" reactions="Oropharyngeal pain, Rhinorrhoea"
 * 
 * @author <NAME>
 *
 */

public class PresentationDataModel {
	
	private ArrayList<PresentationDataRow> presentationDataRows;
	
	public ArrayList<PresentationDataRow> getPresentationDataRows() {
		return presentationDataRows;
	}

	public void setPresentationDataRows(
			ArrayList<PresentationDataRow> presentationDataRows) {
		this.presentationDataRows = presentationDataRows;
	}

	public String toString() {
		
		if(presentationDataRows == null) {
			return "";
		}
		
		//example		
		/*
		 * 
	{"draw":1,"recordedTotal":1,"recordsFiltered":1,"data":
		[
			[
			  "Male",
			  "Tylenol, Asperin",
			  "High blood pressure, dizziness, sweaty plams"
			],
			[
			  "Female",
			  "Tylenol",
			  "High blood pressure, sweaty plams"
			],
			[
			 "Female",
			  "Tylenol, Asperin",
			  "High blood pressure, dizziness"
			]
		]
	}
		 */
		
		StringBuffer stringBuffer = new StringBuffer();
		
		//first brace
		stringBuffer.append("{\"draw\":1,\"recordedTotal\":1,\"recordsFiltered\":1,\"data\":\n");
		
		stringBuffer.append("[\n");//start bracket
		
		//iterate through the values<commit_msg>ADSI 51 - changed first part of string to show record totals. For example<commit_after>package com.wtsintegration.adsi.model;

import java.util.*;

/**
 * Calls used to represent the presentation data model. It consists of an ArrayList
 * of PresentationDataRow objects, each of which is a HashMap, that contains a set of keys
 * and corresponding values. i.e. drugs="LETAIRIS, ADCIRCA, REMODULIN" reactions="Oropharyngeal pain, Rhinorrhoea"
 * 
 * @author <NAME>
 *
 */

public class PresentationDataModel {
	
	private ArrayList<PresentationDataRow> presentationDataRows;
	
	public ArrayList<PresentationDataRow> getPresentationDataRows() {
		return presentationDataRows;
	}

	public void setPresentationDataRows(
			ArrayList<PresentationDataRow> presentationDataRows) {
		this.presentationDataRows = presentationDataRows;
	}

	public String toString() {
		
		if(presentationDataRows == null) {
			return "";
		}
		
		//example		
		/*
		 * 
	{"draw":1,"recordedTotal":1,"recordsFiltered":1,"data":
		[
			[
			  "Male",
			  "Tylenol, Asperin",
			  "High blood pressure, dizziness, sweaty plams"
			],
			[
			  "Female",
			  "Tylenol",
			  "High blood pressure, sweaty plams"
			],
			[
			 "Female",
			  "Tylenol, Asperin",
			  "High blood pressure, dizziness"
			]
		]
	}
		 */
		
		StringBuffer stringBuffer = new StringBuffer();
		
		int recordTotal = 0;
		
		if(presentationDataRows != null) {
			recordTotal = presentationDataRows.size();
		}
		
		//first brace
//		stringBuffer.append("{\"draw\":1,\"recordedTotal\":1,\"recordsFiltered\":1,\"data\":\n");
		stringBuffer.append("{\"draw\":1,\"recordedTotal\":" + recordTotal + ",\"recordsFiltered\":" + recordTotal + ",\"data\":\n");
		
		stringBuffer.append("[\n");//start bracket
		
		//iterate through the values
{'fraction_non_alphanumeric': 0.13099630996309963, 'fraction_numerical': 0.004920049200492005, 'mean_word_length': 3.6405135520684735, 'pattern_counts': {'":': 20, '<': 11, '<?xml version=': 0, '>': 11, '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': '5564653', 'n_tokens_mistral': 1206, 'n_tokens_neox': 985, 'n_words': 235}