import java.util.*;
import java.lang.*;


//Type independant XML input data storage class for Wafers program
public class XMLobject
{
  //independant data
  
  String datatype = new String(); //valid types: stim,user,wafer.
  String filename = new String(); //the name of the wafer file.
  
  //dependant data
  
  // - stim type - 
  String stimName = new String(); //valid types: String text
  String displayType = new String(); //valid types: text
  String displayData = new String(); //valid types: String.
  String poleType = new String(); //valid types: text
  String poleNum = new String(); //valid range: 3 - 3
  Vector poleIDs = new Vector(); //valid types: String, no longer than 3 chars.
  Vector poleValues = new Vector(); //valid types: Double
  Vector poleCues = new Vector(); //valid types: String no longer than 150 chars.
  Vector poleDescrip = new Vector(); //valid types: String.
  
  // - wafer type -
  String waferID = new String(); //valid types: String
  String waferTime = new String(); //valid types: timestamp
  String waferStim = new String(); //valid types: String, stimName
  String waferStatus = new String(); //valid types: String, status
  Vector waferResults = new Vector(); //valid types: String, results data
  // - user and wafer type -
  String subjectName = new String(); //valid types: text
  String subjectClass = new String(); //valid types: String, person
  String knownAs = new String(); //valid tyeps: text, full name
  String applicationID = new String(); //valid types: text, movies
  String description = new String(); //valid types: text
  
  public void print()
  {
    System.out.println("datatype: " + datatype);
    System.out.println("filename: " + filename);
    System.out.println("stimName: " + stimName);
    System.out.println("displayType: " + displayType);
    System.out.println("displayData: " + displayData);
    System.out.println("poleType: " + poleType);
    System.out.println("poleNum: " + poleNum);
    System.out.println("poleIDs: " + poleIDs.toString());
    System.out.println("poleValues: " + poleValues.toString());
    System.out.println("poleCues: " + poleCues.toString());
    System.out.println("poleDescrip: " + poleDescrip.toString());
    System.out.println("waferID: " + waferID);
    System.out.println("waferTime: " + waferTime);
    System.out.println("waferStim: " + waferStim);
    System.out.println("waferStatus: " + waferStatus);
    System.out.println("waferResults: " + waferResults.toString());
    System.out.println("subjectName: " + subjectName);
    System.out.println("subjectClass: " + subjectClass);
    System.out.println("knownAs: " + knownAs);
    System.out.println("applicationID: " + applicationID);
    System.out.println("description: " + description);
  }
  /**
   * Method XML
   */
  public XMLobject() 
  {
    // TODO: Add your code here
  }

  public XMLobject(String file)
  {
    filename = file;
  }

  public void setDatatype(int x)
  {
    if(x == 1)
      datatype = "stim";
    else if(x == 2)
      datatype = "user";
    else if(x == 3)
      datatype = "wafer";
    else
      datatype = "null";
  }
  
  public void setFilename( String x)
  {
    filename = x;
  }
  
  public void setStimName( String x)
  {
    stimName = x;
  }
  
  public void setDisplayType( String x)
  {
    displayType = x;
  }
  
  public void setDisplayData( String x)
  {
    displayData = x;
  }
  
  public void setPoleType( String x)
  {
    poleType = x;
  }
  
  public void setPoleNum( String x)
  {
    poleNum = x;
  }
  
  public void setPoleIDs( String x)
  {
    poleIDs.addElement(x);
  }
  
  public void setPoleValues( String x)
  {
    poleValues.addElement(x);
  }
  
  public void setPoleCues( String x)
  {
    poleCues.addElement(x);
  }

  public void setPoleDescrip( String x)
  {
    poleDescrip.addElement(x);
  }

  public void setWaferID( String x)
  {
    waferID = x;
  }
  
  public void setWaferTime( String x)
  {
    waferTime = x;
  }
  
  public void setWaferStim( String x)
  {
    waferStim = x;
  }
  
  public void setWaferStatus( String x)
  {
    waferStatus = x;
  }
  
  public void addWaferResults( String x)
  {
    waferResults.addElement(x);
  }

  public void setSubjectName( String x)
  {
    subjectName = x;
  }

  public void setSubjectClass( String x)
  {
    subjectClass = x;
  }
  
  public void setKnownAs( String x)
  {
    knownAs = x;
  }
  
  public void setAppID( String x)
  {
    applicationID = x;
  }
  
  public void setDescription( String x)
  {
    description = x;
  }

  public void setPoleValues( String id, String value, String cue, String description)
  {
    poleIDs.addElement(id);
    poleValues.addElement(value);
    poleCues.addElement(cue);
    poleDescrip.addElement(description);
  }
  
  public String getDatatype()
  {
    return datatype;
  }
  
  public String getFilename()
  {
    return filename;
  }
  
  public String getStimName()
  {
    return stimName;
  }
  
  public String getDisplayType()
  {
    return displayType;
  }
  
  public String getDisplayData()
  {
    return displayData;
  }
  
  public String getPoleType()
  {
    return poleType;
  }
  
  public String getPoleNum()
  {
    return poleNum;
  }
  
  public String getPoleIDs(int location)
  {
    return (String)(poleIDs.elementAt(location));
  }
  
  public String getPoleValues(int location)
  {
    return (String)(poleValues.elementAt(location));
  }
  
  public String getPoleCues(int location)
  {
    return (String)(poleCues.elementAt(location));
  }
  
  public String getPoleDescrip(int location)
  {
    return (String)(poleDescrip.elementAt(location));
  }
  
  public String getWaferID()
  {
    return waferID;
  }
  
  public String getWaferTime()
  {
    return waferTime;
  }
  
  public String getWaferStim()
  {
    return waferStim;
  }
  
  public String getWaferStatus()
  {
    return waferStatus;
  }
  
  public String getWaferResults(int location)
  {
    return (String)(waferResults.elementAt(location));
  }
  
  public String getSubjectName()
  {
    return subjectName;
  }
  
  public String getSubjectClass()
  {
    return subjectClass;
  }
  
  public String getKnownAs()
  {
    return knownAs;
  }
  
  public String getApplicationID()
  {
    return applicationID;
  }
  
  public String getDescription()
  {
    return description;
  }
}
