<commit_before>package gov.nih.nci.calab.dto.characterization;

import gov.nih.nci.calab.domain.nano.characterization.physical.Size;

import java.util.List;


/**
 * This class represents the size characterization information to be shown in
 * the view page.
 * 
 * @author pansu
 * 
 */
public class SizeBean extends CharacterizationBean {
	public SizeBean() {
		super();
		for (CharacterizationTableBean table: getCharacterizationTables()) {
			CharacterizationTableDataBean average=new CharacterizationTableDataBean();
			average.setType("Average");
			CharacterizationTableDataBean zaverage=new CharacterizationTableDataBean();
			average.setType("Z-Average");
			CharacterizationTableDataBean pdi=new CharacterizationTableDataBean();
			average.setType("PDI");
			table.getTableDataList().add(average);
			table.getTableDataList().add(zaverage);
			table.getTableDataList().add(pdi);
		}
	}
	
	public void setCharacterizationTables(
			List<CharacterizationTableBean> characterizationTables) {
		super.setCharacterizationTables(characterizationTables);
		
		for (CharacterizationTableBean table:getCharacterizationTables()) {
			CharacterizationTableDataBean average=new CharacterizationTableDataBean();
			average.setType("Average");
			average.setValueUnit("nm");
			CharacterizationTableDataBean zaverage=new CharacterizationTableDataBean();
			zaverage.setType("Z-Average");
			zaverage.setValueUnit("nm");
			CharacterizationTableDataBean pdi=new CharacterizationTableDataBean();
			pdi.setType("PDI");
			table.getTableDataList().add(average);
			table.getTableDataList().add(zaverage);
			table.getTableDataList().add(pdi);
		}
	}
	
	public Size getDomainObj() {
		Size size = new Size();
		super.updateDomainObj(size);
		return size;
	}<commit_msg>moved the initialization code to separate method, and added code to create characterizationTableBean.<commit_after>package gov.nih.nci.calab.dto.characterization;

import gov.nih.nci.calab.domain.nano.characterization.physical.Size;
import gov.nih.nci.calab.domain.nano.characterization.Characterization;
import gov.nih.nci.calab.domain.nano.characterization.CharacterizationTable;

import java.util.List;


/**
 * This class represents the size characterization information to be shown in
 * the view page.
 * 
 * @author pansu
 * 
 */
public class SizeBean extends CharacterizationBean {
	public SizeBean() {
		super();
		initSetup();
	}
	
	public SizeBean(Characterization aChar) {
		super();
		this.setCharacterizationSource(aChar.getSource());
		this.setViewTitle(aChar.getIdentificationName());
		this.setDescription(aChar.getDescription());
		if (aChar.getInstrument() != null) {
			this.getInstrument().setType(aChar.getInstrument().getType());
			this.getInstrument().setDescription(aChar.getInstrument().getDescription());
			this.getInstrument().setManufacturer(aChar.getInstrument().getManufacturer());
		}
		this.setNumberOfCharacterizationTables(Integer.valueOf(aChar.getCharacterizationTableCollection().size()).toString());
		for (CharacterizationTable table : aChar.getCharacterizationTableCollection()) {
			CharacterizationTableBean ctBean = new CharacterizationTableBean(table);
			this.getCharacterizationTables().add(ctBean);
		}
	}
	
	public void setCharacterizationTables(
			List<CharacterizationTableBean> characterizationTables) {
		super.setCharacterizationTables(characterizationTables);
		initSetup();
	}
	
	public void initSetup() {
		for (CharacterizationTableBean table:getCharacterizationTables()) {
			CharacterizationTableDataBean average=new CharacterizationTableDataBean();
			average.setType("Average");
			average.setValueUnit("nm");
			CharacterizationTableDataBean zaverage=new CharacterizationTableDataBean();
			zaverage.setType("Z-Average");
			zaverage.setValueUnit("nm");
			CharacterizationTableDataBean pdi=new CharacterizationTableDataBean();
			pdi.setType("PDI");
			table.getTableDataList().add(average);
			table.getTableDataList().add(zaverage);
			table.getTableDataList().add(pdi);
		}
	}
	
	public Size getDomainObj() {
		Size size = new Size();
		super.updateDomainObj(size);
		return size;
	}
{'fraction_non_alphanumeric': 0.1137855579868709, 'fraction_numerical': 0.0, 'mean_word_length': 6.093103448275862, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4040584', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1164, 'n_words': 195}