All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jlibsedml.Report Maven / Gradle / Ivy

Go to download

Java library for reading, writing, validating and working with SED-ML files.

The newest version!
package org.jlibsedml;

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

/**
 * Represents the SED-ML 'Report' element for describing textual output of 
 *  a simulation.
 * @author radams
 *
 */
public final class Report extends Output {

	private ArrayList listOfDataSets;

		/**
		 * 
		 * @param id A unique String identifier for this object.
		 * @param name An optional String name for this object.
		 */
	   public Report(String id, String name) {
		   super(id, name);
		   listOfDataSets = new ArrayList();
	   }
	   
	   @Override
		public String getElementName() {
			return SEDMLTags.OUTPUT_REPORT;
		}
	   
	   /**
	    * Getter for a read-only list of {@link DataSet} objects contained in this report.
	    * @return non-null but possibly empty List .
	    */
	   public List getListOfDataSets() {
		   return Collections.unmodifiableList(listOfDataSets);
	   }
	   
	   /**
		 * Adds a {@link DataSet} to this object's list of DataSets, if not already present.
		 * @param dataSet A non-null {@link DataSet} element
		 * @return true if dataSet added, false  otherwise.
		 */
		public boolean addDataSet(DataSet dataSet ){
			if(!listOfDataSets.contains(dataSet))
				return listOfDataSets.add(dataSet);
			return false;
		}
		
		  /**
		 * Removes a {@link DataSet} from this object's list of DataSets.
		 * @param dataSet A non-null {@link DataSet} element
		 * @return true if dataSet removed, false  otherwise.
		 */
		public boolean removeDataSet(DataSet dataSet ){
			
				return listOfDataSets.remove(dataSet);
			
		}
	   
		/**
	     * Gets the type of this output.
	     * 
	     * @return SEDMLTags.REPORT_KIND
	     */
	   public String getKind() {
		   return SEDMLTags.REPORT_KIND;
	   }

	@Override
	public List  getAllDataGeneratorReferences() {
		List rc = new ArrayList();
		for (DataSet d : listOfDataSets){
			rc.add(d.getDataReference());
		}
		return rc;
	}

	@Override
	public List getAllIndependentDataGeneratorReferences() {
		return Collections.emptyList();
	}
	   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy