/*Generator.java*/
/* A Java class for
 * LossyWide.java
 * Electromagnetic Transmission Line Applet
 * Applet without Smith Chart - Prepared by Umberto Ravaioli 
 * for 6th edition of Fundamentals of Applied Electromagnetics Book
 * May 2009 - All Rights Reserved
 */ 

public class Generator{
	private Complex Vg;
	private Complex Zg;

	public Generator(){
		Vg = new Complex(1.0,0.0);
		Zg = new Complex(100.0,0.0);
	} 

	public Generator(Complex Vg, Complex Zg){
		this.Vg=(Complex)Vg.clone();
		this.Zg=(Complex)Zg.clone();
	}

	public final String toString(){
		String tmp;
		tmp="Generator: ";
		tmp=tmp+"Vg="+Vg.toString()+",  Zg="+Zg.toString()+".\n";
		return tmp;
	}

	public final synchronized void setVg(Complex Vg){
		this.Vg=(Complex)Vg.clone();
	}

	public final synchronized void setZg(Complex Zg){
		this.Zg=(Complex)Zg.clone();
	}

	public final Complex getVg(){
		return (Complex)Vg.clone();
	}

	public final Complex getZg(){
		return (Complex)Zg.clone();
	}
}
