
/**
 * DonorAcceptorData.java
 * This stores all the DyeSpectra objects.
 * Created: May 30, 2006
 *
 * @author Nathan Stevens
 * @version 0.1 6/19/2006
 */
import java.util.*;
import java.io.*;

public class DonorAcceptorData implements Serializable {
  private String name = null; // name of the database
  private Vector dyeData = null;
  private String[] metaInfo = null;
  private String notes = null;
  private transient File file = null;
  
  // default constructor
  public DonorAcceptorData() { }
  
  // method 
  public DonorAcceptorData(String name, String[] metaInfo) {
    this.name = name;
    this.metaInfo = metaInfo;
    dyeData = new Vector();
    notes = "none";
  }
  
  // Method to return the return at whole spectra data
  public Vector getDyeData() {
    return dyeData;
  }
  
  // Method to ste the Dye Data
  public void setDyeData(Vector dyeData) {
    this.dyeData = dyeData;
  }
  
  // Method to add a dye spectra
  public void addDyeSpectra(DyeSpectra spectra) {
    dyeData.addElement(spectra);
  }
  
  // Method to return a dye spectra at a certain vector
  public DyeSpectra getDyeSpectra(int index) {
	  return (DyeSpectra)dyeData.elementAt(index);
  }
  
  // Method to return the number of dye spectra data
  public int size() {
	  return dyeData.size();
  }
  
  // Method to remove a dye spectra data
  public void remove(int index) {
    dyeData.removeElementAt(index);
  }
  
  // Method to remove a dye spectra data
  public void remove(DyeSpectra ds) {
    dyeData.removeElement(ds);
  }
  
  // Method to remove all spectra data
  public void removeAll() {
    dyeData.removeAllElements();
  }
  
  // Method to return the meta info
  public String[] getMetaInfo() {
    return metaInfo;
  }
  
  // Method to set the meta info
  public void setMetaInfo(String[] metaInfo) {
    this.metaInfo = metaInfo;
  }
  
  // Method to set a note
  public String getNotes() {
    return notes;
  }
  
  // Method to set the lifetime
  public void setNotes(String notes) {
    this.notes = notes;
  }
  
  // Method to get the file
  public File getFile() {
    return file;
  }
  
  // Method to set the file name
  public void setFile(File file) {
    this.file = file;
  }
  
  // Method to sort the array
  public void sort() {
    Collections.sort(dyeData);
  }
  
  // Method to set a note
  public String getName() {
    return name;
  }
  
  // Method to set the lifetime
  public void setName(String name) {
    this.name = name;
  }
  
  // Method to return the name
  public String toString() {
    return name;
  }
}//--end class DonorAcceptotData
