/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TestRest.converter;

import java.util.List;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
/**
 *
 * @author aparnab
 */
public class OriginConverter {
    @XmlElement(name="time")
    private List<TimeConverter> time;
    @XmlElement(name="latitude")
    private List<LatConverter> lati;
    @XmlElement(name="longitude")
    private List<LonConverter> longi;
    @XmlElement(name="depth")
    private List<DepthConverter> depth;
    @XmlElement(name="quality")
    private List<QualityConverter> quality;
    @XmlAttribute
    private String publicID;

    public OriginConverter(){
    }

    public OriginConverter(float ilat, float ilon, float idepth, Long iquality, Long itime){
        LatConverter temp;
        LonConverter lon;
        DepthConverter tempDepth;
        QualityConverter tempQuality;
        TimeConverter tempTime;
        this.lati = new ArrayList<LatConverter>();
        temp = new LatConverter();
        temp.setValue(ilat);
        this.lati.add(temp);

        this.longi = new ArrayList<LonConverter>();
        lon = new LonConverter();
        lon.setValue(ilon);
        this.longi.add(lon);

        this.depth = new ArrayList<DepthConverter>();
        tempDepth = new DepthConverter();
        tempDepth.setValue(idepth);
        this.depth.add(tempDepth);

        this.quality = new ArrayList<QualityConverter>();
        tempQuality = new QualityConverter();
        tempQuality.setPhase(iquality);
        this.quality.add(tempQuality);

        this.time = new ArrayList<TimeConverter>();
        tempTime = new TimeConverter();
        tempTime.setTime(itime);
        this.time.add(tempTime);
    }
    /*
    public Long getTime(){
        return this.time;
    }
    public void setTime(Long itime){
        this.time = itime;
    }
     */
    public String getPublicID() {
        return this.publicID;
    }
    //public void setPublicID(Long imagid){
    public void setPublicID(Long orid){
        this.publicID = "smi:data.scec.org/origin/" + orid.toString();
    }
}
