(boolean forward)
| 166 | } |
| 167 | |
| 168 | private Vector getMIVector(boolean forward) { |
| 169 | readBlock(forward); |
| 170 | |
| 171 | Vector listMessages = new Vector(); |
| 172 | int pos = 0; |
| 173 | first_m = last_m = -1; |
| 174 | |
| 175 | do { |
| 176 | int start = findOpenStr(current_block, pos, true, 'm'); |
| 177 | int end = findCloseStr(current_block, start + 3, true, 'm'); |
| 178 | |
| 179 | if (start < 0 || end < 0) { |
| 180 | if ((first_m < 0) || (last_m < 0)) { |
| 181 | boolean can_step_back = true; |
| 182 | boolean can_step_next = true; |
| 183 | if (forward) |
| 184 | can_step_back = !inBegin(); |
| 185 | else can_step_next = !inEnd(); |
| 186 | |
| 187 | StringBuffer bigMessage = new StringBuffer(); |
| 188 | |
| 189 | do { |
| 190 | if (forward) { |
| 191 | bigMessage.append(getSubstr(start, current_block.length-start)); |
| 192 | readBlock(forward); |
| 193 | end = findCloseStr(current_block, 0, true, 'm'); |
| 194 | } else { |
| 195 | bigMessage.insert(0, getSubstr(0, end)); |
| 196 | readBlock(forward); |
| 197 | start = findOpenStr(current_block, current_block.length-3, false, 'm'); |
| 198 | } |
| 199 | first_m = 0; |
| 200 | last_m = current_block.length - 3; |
| 201 | } while (start < 0 || end < 0); |
| 202 | |
| 203 | if (forward) { |
| 204 | bigMessage.append(getSubstr(start + 3, end - start - 3)); |
| 205 | can_step_next = !inEnd(); |
| 206 | } else { |
| 207 | bigMessage.insert(0, getSubstr(start + 3, end - start - 3)); |
| 208 | can_step_back = !inBegin(); |
| 209 | } |
| 210 | |
| 211 | current_block = null; |
| 212 | |
| 213 | String current = bigMessage.toString(); |
| 214 | bigMessage = null; |
| 215 | listMessages.addElement(getMessageItem(processMessage( |
| 216 | findBlock(current, "t"), |
| 217 | findBlock(current, "d"), |
| 218 | findBlock(current, "f"), |
| 219 | findBlock(current, "s"), |
| 220 | findBlock(current, "b")))); |
| 221 | |
| 222 | if (can_step_back) |
| 223 | listMessages.insertElementAt(HistoryReader.MIPrev, 0); |
| 224 | if (can_step_next) |
| 225 | listMessages.addElement(HistoryReader.MINext); |
no test coverage detected