/Users/lyon/j4p/src/math/ComplexArray.java

1    package math; 
2     
3     
4    class ComplexArray { 
5      Complex elements[] = null; 
6     
7      ComplexArray(int size) { 
8        elements = new Complex[size]; 
9     
10     } 
11    
12     void set(int elementNumber, double r, double i) { 
13       elements[elementNumber].set(r, i); 
14     } 
15    
16     double getReal(int elementNumber) { 
17       return elements[elementNumber].getReal(); 
18     } 
19    
20     double getImaginary(int elementNumber) { 
21       return elements[elementNumber].getImaginary(); 
22     } 
23    
24     void setReal(int elementNumber, double r) { 
25       elements[elementNumber].setReal(r); 
26     } 
27    
28     void addReal(int elementNumber, double r) { 
29       elements[elementNumber].addReal(r); 
30     } 
31    
32     void addImaginary(int elementNumber, double i) { 
33       elements[elementNumber].addImaginary(i); 
34     } 
35    
36     void setImaginary(int elementNumber, double i) { 
37       elements[elementNumber].setImaginary(i); 
38     } 
39   }