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

import gov.nih.nci.calab.domain.Measurement;
import gov.nih.nci.calab.domain.nano.characterization.physical.Surface;
import gov.nih.nci.calab.domain.nano.characterization.physical.SurfaceChemistry;
import gov.nih.nci.calab.dto.characterization.CharacterizationBean;
import gov.nih.nci.calab.dto.characterization.DerivedBioAssayDataBean;
import gov.nih.nci.calab.dto.characterization.composition.SurfaceGroupBean;
import gov.nih.nci.calab.service.util.CananoConstants;

import java.util.ArrayList;
import java.util.List;

/**
 * This class represents the size characterization information to be shown in
 * the view page.
 * 
 * @author pansu
 * 
 */
public class SurfaceBean extends CharacterizationBean {

	private String surfaceArea;
	
	private String surfaceAreaUnit;

	private String zetaPotential;

	private String charge;

	private String chargeUnit;

	private String isHydrophobic;
	
	private int numberOfSurfaceChemistry;

	private List<SurfaceChemistryBean> surfaceChemistries = new ArrayList<SurfaceChemistryBean>();

	public SurfaceBean() {
		super();
		surfaceChemistries = new ArrayList<SurfaceChemistryBean>();
		initSetup();
	}

	public SurfaceBean(Surface aChar) {
		super(aChar);
		
		this.charge = (aChar.getCharge() != null)?aChar.getCharge().getValue():"";
		this.chargeUnit = (aChar.getCharge() != null)?aChar.getCharge().getUnitOfMeasurement():"";
		this.isHydrophobic = aChar.getIsHydrophobic().toString();
		this.surfaceArea = (aChar.getSurfaceArea() != null)?aChar.getSurfaceArea().getValue().toString():"";
		this.surfaceAreaUnit = (aChar.getSurfaceArea() != null)?aChar.getSurfaceArea().getUnitOfMeasurement():"";
		this.zetaPotential = (aChar.getZetaPotential() != null)?aChar.getZetaPotential().getValue():"";
		
		for (SurfaceChemistry surfaceChemistry : aChar.getSurfaceChemistryCollection()) {
			SurfaceChemistryBean surfaceChemistryBean = new SurfaceChemistryBean(surfaceChemistry);
			surfaceChemistries.add(surfaceChemistryBean);
		}
		this.numberOfSurfaceChemistry = surfaceChemistries.size();
		
	}

	public String getCharge() {
		return charge;
	}

	public void setCharge(String charge) {
		this.charge = charge;
	}

	public String getIsHydrophobic() {
		return isHydrophobic;
	}

	public void setIsHydrophobic(String isHydrophobic) {
		this.isHydrophobic = isHydrophobic;
	}

	public String getSurfaceArea() {
		return surfaceArea;
	}

	public void setSurfaceArea(String surfaceArea) {
		this.surfaceArea = surfaceArea;
	}

	public String getZetaPotential() {
		return zetaPotential;
	}

	public void setZetaPotential(String zetaPotential) {
		this.zetaPotential = zetaPotential;
	}

	public void setDerivedBioAssayData(
			List<DerivedBioAssayDataBean> derivedBioAssayData) {
		super.setDerivedBioAssayData(derivedBioAssayData);
		initSetup();
	}

	public String getChargeUnit() {
		return chargeUnit;
	}

	public void setChargeUnit(String chargeUnit) {
		this.chargeUnit = chargeUnit;
	}

	public List<SurfaceChemistryBean> getSurfaceChemistries() {
		return surfaceChemistries;
	}

	public void setSurfaceChemistries(List<SurfaceChemistryBean> surfaceGroups) {
		this.surfaceChemistries = surfaceGroups;
	}

	public String getSurfaceAreaUnit() {
		return surfaceAreaUnit;
	}

	public void setSurfaceAreaUnit(String surfaceAreaUnit) {
		this.surfaceAreaUnit = surfaceAreaUnit;
	}

	public void initSetup() {
//		for (DerivedBioAssayDataBean table : getDerivedBioAssayData()) {
//			DatumBean average = new DatumBean();
//			average.setType("Average");
//			average.setValueUnit("nm");
//			DatumBean zaverage = new DatumBean();
//			zaverage.setType("Z-Average");
//			zaverage.setValueUnit("nm");
//			DatumBean pdi = new DatumBean();
//			pdi.setType("PDI");
//			table.getDatumList().add(average);
//			table.getDatumList().add(zaverage);
//			table.getDatumList().add(pdi);
//		}
	}

	public Surface getDomainObj() {
		Surface surface = new Surface();
		super.updateDomainObj(surface);
		boolean hycrophobicStatus = (isHydrophobic.equalsIgnoreCase(CananoConstants.BOOLEAN_YES)) ? true
				: false;
		surface.setIsHydrophobic(hycrophobicStatus);
		surface.setCharge(new Measurement(charge,chargeUnit));
		surface.setZetaPotential(new Measurement(zetaPotential, "mV"));
		
		surface.setSurfaceArea(new Measurement(surfaceArea, surfaceAreaUnit));
		
		for (SurfaceChemistryBean surfaceChemistry : surfaceChemistries) {
			surface.getSurfaceChemistryCollection().add(surfaceChemistry.getDomainObj());
		}
		return surface;
	}


	public int getNumberOfSurfaceChemistry() {
		return numberOfSurfaceChemistry;
	}

	public void setNumberOfSurfaceChemistry(int numberOfSurfaceChemistry) {
		this.numberOfSurfaceChemistry = numberOfSurfaceChemistry;
	}
}<commit_msg>zetaPotential is Float type.<commit_after>package gov.nih.nci.calab.dto.characterization.physical;

import gov.nih.nci.calab.domain.Measurement;
import gov.nih.nci.calab.domain.nano.characterization.physical.Surface;
import gov.nih.nci.calab.domain.nano.characterization.physical.SurfaceChemistry;
import gov.nih.nci.calab.dto.characterization.CharacterizationBean;
import gov.nih.nci.calab.dto.characterization.DerivedBioAssayDataBean;
import gov.nih.nci.calab.dto.characterization.composition.SurfaceGroupBean;
import gov.nih.nci.calab.service.util.CananoConstants;

import java.util.ArrayList;
import java.util.List;

/**
 * This class represents the size characterization information to be shown in
 * the view page.
 * 
 * @author pansu
 * 
 */
public class SurfaceBean extends CharacterizationBean {

	private String surfaceArea;
	
	private String surfaceAreaUnit;

	private String zetaPotential;

	private String charge;

	private String chargeUnit;

	private String isHydrophobic;
	
	private int numberOfSurfaceChemistry;

	private List<SurfaceChemistryBean> surfaceChemistries = new ArrayList<SurfaceChemistryBean>();

	public SurfaceBean() {
		super();
		surfaceChemistries = new ArrayList<SurfaceChemistryBean>();
		initSetup();
	}

	public SurfaceBean(Surface aChar) {
		super(aChar);
		
		this.charge = (aChar.getCharge() != null)?aChar.getCharge().getValue():"";
		this.chargeUnit = (aChar.getCharge() != null)?aChar.getCharge().getUnitOfMeasurement():"";
		this.isHydrophobic = aChar.getIsHydrophobic().toString();
		this.surfaceArea = (aChar.getSurfaceArea() != null)?aChar.getSurfaceArea().getValue().toString():"";
		this.surfaceAreaUnit = (aChar.getSurfaceArea() != null)?aChar.getSurfaceArea().getUnitOfMeasurement():"";
		//this.zetaPotential = (aChar.getZetaPotential() != null)?aChar.getZetaPotential().getValue():"";
		this.zetaPotential = (aChar.getZetaPotential() != null) ? aChar.getZetaPotential().toString() : "";
		
		for (SurfaceChemistry surfaceChemistry : aChar.getSurfaceChemistryCollection()) {
			SurfaceChemistryBean surfaceChemistryBean = new SurfaceChemistryBean(surfaceChemistry);
			surfaceChemistries.add(surfaceChemistryBean);
		}
		this.numberOfSurfaceChemistry = surfaceChemistries.size();
		
	}

	public String getCharge() {
		return charge;
	}

	public void setCharge(String charge) {
		this.charge = charge;
	}

	public String getIsHydrophobic() {
		return isHydrophobic;
	}

	public void setIsHydrophobic(String isHydrophobic) {
		this.isHydrophobic = isHydrophobic;
	}

	public String getSurfaceArea() {
		return surfaceArea;
	}

	public void setSurfaceArea(String surfaceArea) {
		this.surfaceArea = surfaceArea;
	}

	public String getZetaPotential() {
		return zetaPotential;
	}

	public void setZetaPotential(String zetaPotential) {
		this.zetaPotential = zetaPotential;
	}

	public void setDerivedBioAssayData(
			List<DerivedBioAssayDataBean> derivedBioAssayData) {
		super.setDerivedBioAssayData(derivedBioAssayData);
		initSetup();
	}

	public String getChargeUnit() {
		return chargeUnit;
	}

	public void setChargeUnit(String chargeUnit) {
		this.chargeUnit = chargeUnit;
	}

	public List<SurfaceChemistryBean> getSurfaceChemistries() {
		return surfaceChemistries;
	}

	public void setSurfaceChemistries(List<SurfaceChemistryBean> surfaceGroups) {
		this.surfaceChemistries = surfaceGroups;
	}

	public String getSurfaceAreaUnit() {
		return surfaceAreaUnit;
	}

	public void setSurfaceAreaUnit(String surfaceAreaUnit) {
		this.surfaceAreaUnit = surfaceAreaUnit;
	}

	public void initSetup() {
//		for (DerivedBioAssayDataBean table : getDerivedBioAssayData()) {
//			DatumBean average = new DatumBean();
//			average.setType("Average");
//			average.setValueUnit("nm");
//			DatumBean zaverage = new DatumBean();
//			zaverage.setType("Z-Average");
//			zaverage.setValueUnit("nm");
//			DatumBean pdi = new DatumBean();
//			pdi.setType("PDI");
//			table.getDatumList().add(average);
//			table.getDatumList().add(zaverage);
//			table.getDatumList().add(pdi);
//		}
	}

	public Surface getDomainObj() {
		Surface surface = new Surface();
		super.updateDomainObj(surface);
		boolean hycrophobicStatus = (isHydrophobic.equalsIgnoreCase(CananoConstants.BOOLEAN_YES)) ? true
				: false;
		surface.setIsHydrophobic(hycrophobicStatus);
		surface.setCharge(new Measurement(charge,chargeUnit));
		//surface.setZetaPotential(new Measurement(zetaPotential, "mV"));
		surface.setZetaPotential(new Float(zetaPotential));
		
		surface.setSurfaceArea(new Measurement(surfaceArea, surfaceAreaUnit));
		
		for (SurfaceChemistryBean surfaceChemistry : surfaceChemistries) {
			surface.getSurfaceChemistryCollection().add(surfaceChemistry.getDomainObj());
		}
		return surface;
	}


	public int getNumberOfSurfaceChemistry() {
		return numberOfSurfaceChemistry;
	}

	public void setNumberOfSurfaceChemistry(int numberOfSurfaceChemistry) {
		this.numberOfSurfaceChemistry = numberOfSurfaceChemistry;
	}
}
{'fraction_non_alphanumeric': 0.11300771208226221, 'fraction_numerical': 0.0, 'mean_word_length': 5.505685618729097, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3873200', 'n_tokens_mistral': 3494, 'n_tokens_neox': 3046, 'n_words': 523}