Deletes the specified slice, where {@literal 1<=n<=nslices}.
(int n)
| 168 | |
| 169 | /** Deletes the specified slice, where {@literal 1<=n<=nslices}. */ |
| 170 | public void deleteSlice(int n) { |
| 171 | if (n<1 || n>nSlices) |
| 172 | throw new IllegalArgumentException(outOfRange+n); |
| 173 | if (nSlices<1) |
| 174 | return; |
| 175 | for (int i=n; i<nSlices; i++) { |
| 176 | stack[i-1] = stack[i]; |
| 177 | label[i-1] = label[i]; |
| 178 | } |
| 179 | stack[nSlices-1] = null; |
| 180 | label[nSlices-1] = null; |
| 181 | nSlices--; |
| 182 | } |
| 183 | |
| 184 | /** Deletes the last slice in the stack. */ |
| 185 | public void deleteLastSlice() { |
no outgoing calls
no test coverage detected