
package cdpp3dview.types;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


/**
 * <p>Java class for Tuple3d complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="Tuple3d">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="x" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *         &lt;element name="y" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *         &lt;element name="z" type="{http://www.w3.org/2001/XMLSchema}double"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Tuple3d", propOrder = {
    "x",
    "y",
    "z"
})
public class Tuple3D {

    protected double x;
    protected double y;
    protected double z;

    public Tuple3D() {
    }

    @Override
    public String toString() {
        return "Tuple3D{" + x + ","+ y + "," + z + '}';
    }

    public Tuple3D(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    /**
     * Get x/y/z component for 0,1,2.
     * @param i 0=x, 1=y, 2=z else returns x
     */
    public double get(int i) {
        if(i==0) return x;
        if(i==1) return y;
        if(i==2) return z;
        return x;
    }
    
    /**
     * set x/y/z component.
     * @param i 0=x, 1=y, 2=z else returns x
     * @param val value to set.
     */
    public void set(int i, double val) {
        if(i==0) x=val;
        if(i==1) y=val;
        if(i==2) z=val;
    }
    
    /**
     * Gets the value of the x property.
     * 
     */
    public double getX() {
        return x;
    }

    /**
     * Sets the value of the x property.
     * 
     */
    public void setX(double value) {
        this.x = value;
    }

    /**
     * Gets the value of the y property.
     * 
     */
    public double getY() {
        return y;
    }

    /**
     * Sets the value of the y property.
     * 
     */
    public void setY(double value) {
        this.y = value;
    }

    /**
     * Gets the value of the z property.
     * 
     */
    public double getZ() {
        return z;
    }

    /**
     * Sets the value of the z property.
     * 
     */
    public void setZ(double value) {
        this.z = value;
    }

}
