(String temp, int s)
| 34 | int[][] invK; |
| 35 | |
| 36 | public void performDivision(String temp, int s) { |
| 37 | while (temp.length() > s) { |
| 38 | String line = temp.substring(0, s); |
| 39 | temp = temp.substring(s, temp.length()); |
| 40 | calLineMatrix(line); |
| 41 | if (choice == 1) { |
| 42 | multiplyLineByKey(line.length()); |
| 43 | } else { |
| 44 | multiplyLineByInvKey(line.length()); |
| 45 | } |
| 46 | showResult(line.length()); |
| 47 | } |
| 48 | if (temp.length() == s) { |
| 49 | |
| 50 | if (choice == 1) { |
| 51 | calLineMatrix(temp); |
| 52 | multiplyLineByKey(temp.length()); |
| 53 | showResult(temp.length()); |
| 54 | } else { |
| 55 | calLineMatrix(temp); |
| 56 | this.multiplyLineByInvKey(temp.length()); |
| 57 | showResult(temp.length()); |
| 58 | } |
| 59 | } else if (temp.length() < s) { |
| 60 | for (int i = temp.length(); i < s; i++) |
| 61 | temp = temp + 'x'; |
| 62 | if (choice == 1) { |
| 63 | calLineMatrix(temp); |
| 64 | multiplyLineByKey(temp.length()); |
| 65 | showResult(temp.length()); |
| 66 | } else { |
| 67 | calLineMatrix(temp); |
| 68 | multiplyLineByInvKey(temp.length()); |
| 69 | showResult(temp.length()); |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | public void calKeyMatrix(String key, int len) { |
| 75 | km = new int[len][len]; |
no test coverage detected