1 4 package gnu.math; 5 import java.io.*; 6 7 11 12 public class CComplex extends Complex implements Externalizable 13 { 14 RealNum real; 15 RealNum imag; 16 17 public CComplex () 18 { 19 } 20 21 public CComplex (RealNum real, RealNum imag) 22 { 23 this.real = real; 24 this.imag = imag; 25 } 26 27 public RealNum re() { return real; } 28 public RealNum im() { return imag; } 29 30 33 public void writeExternal(ObjectOutput out) throws IOException 34 { 35 out.writeObject(real); 36 out.writeObject(imag); 37 } 38 39 public void readExternal(ObjectInput in) 40 throws IOException, ClassNotFoundException 41 { 42 real = (RealNum) in.readObject(); 43 imag = (RealNum) in.readObject(); 44 } 45 } 46 | Popular Tags |