?? matrix.java
字號:
// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 2/13/2008 10:16:10 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Matrix.java
public class Matrix
{
public Matrix(int i, int j)
{
matrix = new int[i][j];
}
public void validateParameters(int i, int j)
{
if(i >= getNumRows())
throw new IndexOutOfBoundsException((new StringBuilder()).append("This matrix has only ").append(getNumRows()).append(" rows ").append(" you requested ").append(i).append("!").toString());
if(j >= getNumColumns())
throw new IndexOutOfBoundsException((new StringBuilder()).append("This matrix has only ").append(getNumColumns()).append(" columns you requested ").append(j).append("!").toString());
else
return;
}
public int get(int i, int j)
{
validateParameters(i, j);
return matrix[i][j];
}
public void set(int i, int j, int k)
{
validateParameters(i, j);
matrix[i][j] = k;
}
public int getNumRows()
{
return matrix.length;
}
public int getNumColumns()
{
if(getNumRows() == 0)
return 0;
else
return matrix[0].length;
}
protected int matrix[][];
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -