Der Datentyp Matrize


package fft;

class Matrix {
        
        Object[][] data;
        
        Matrix(int rows, int cols) {
                data = new Object[rows][cols];
        }
        
        void setValue(int row, int column, Object o) {
                data[row][column] = o;
        }
        
        Object getValue(int row, int column) {
                return data[row][column];
        }
        
        public String toString() {
                String result = "";
                for(int i = 0; i < 4; i++) {
                        result += "|";
                        for(int j = 0; j < 4; j++) {
                                result += " (" + data[i][j] + ")";
                        }
                        result += "|" + System.getProperty("line.separator");
                }
                return result;
        }
}

-- ChristopherHuhn - 12 Dec 2003
Topic revision: r1 - 2003-12-12, christo
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)