
/**
 * ExperimentData.java
 * This is stores all the SpectraData objects from an experiment.
 * Created: Dec 27, 2003
 *
 * @author Nathan Stevens
 * @version 0.1 1/14/2004 
 */
import java.util.*;
import java.io.*;

public class ExperimentData implements Serializable {
  private String type;
  private Vector dataObjects;
  private String notes;
  
  // default constructor
  public ExperimentData() { }
  
  public ExperimentData(String type) {
    this.type = type;
    dataObjects = new Vector();
    notes = "Notebook page (Date) : ";
  }
  
  // Method to get the name of the experiment
  public String  getType() {
    return type;
  }
  
  // Method to add a data object
  public void addData(SpectraData sdata) {
	  dataObjects.addElement(sdata);
  }
  
  // Method to get the dataObjects
  public Vector getData() {
	  return dataObjects;
  }
  
  // Method to return the OOData at a specific index
  public SpectraData getData(int index) {
	  return (SpectraData)dataObjects.elementAt(index);
  }
  
  // Method to return the number of data objects in the experiment file
  public int getDataCount() {
	  return dataObjects.size();
  }
  
  // Method to remove a spectra data
  public void remove(int index) {
    dataObjects.removeElementAt(index);
  }
  
  // Method to remove all spectra data
  public void removeAll(int index) {
    dataObjects.removeAllElements();
  }
  
  // Method to set notes for the data contained within
  public void setNotes(String notes) {
    this.notes = notes;
  }
  
  // Method get the notes
  public String getNotes() {
    return notes;
  }
} // --End of ExperimentData.java
