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;
}
}
--
Christo - 12 Dec 2003