(String value)
| 207 | |
| 208 | // Remove the first instance of a particular value and return its index. |
| 209 | public int removeValue(String value) { |
| 210 | if (value == null) { |
| 211 | for (int i = 0; i < count; i++) { |
| 212 | if (data[i] == null) { |
| 213 | remove(i); |
| 214 | return i; |
| 215 | } |
| 216 | } |
| 217 | } else { |
| 218 | int index = index(value); |
| 219 | if (index != -1) { |
| 220 | remove(index); |
| 221 | return index; |
| 222 | } |
| 223 | } |
| 224 | return -1; |
| 225 | } |
| 226 | |
| 227 | |
| 228 | // Remove all instances of a particular value and return the count removed. |