32 |
/** |
/** |
33 |
* The <code>Vector</code> classes implements growable arrays of Objects. |
* The <code>Vector</code> classes implements growable arrays of Objects. |
34 |
* You can access elements in a Vector with an index, just as you |
* You can access elements in a Vector with an index, just as you |
35 |
* can in a built in array, but Vectors can grow and shrink to accomodate |
* can in a built in array, but Vectors can grow and shrink to accommodate |
36 |
* more or fewer objects.<p> |
* more or fewer objects.<p> |
37 |
* |
* |
38 |
* Vectors try to mantain efficiency in growing by having a |
* Vectors try to mantain efficiency in growing by having a |
300 |
} |
} |
301 |
|
|
302 |
/** |
/** |
303 |
* Returns the first occurence of <code>elem</code> in the Vector, or -1 if |
* Returns the first occurrence of <code>elem</code> in the Vector, or -1 if |
304 |
* <code>elem</code> is not found. |
* <code>elem</code> is not found. |
305 |
* |
* |
306 |
* @param elem the object to search for |
* @param elem the object to search for |
307 |
* @return the index of the first occurence, or -1 if not found |
* @return the index of the first occurrence, or -1 if not found |
308 |
*/ |
*/ |
309 |
public int indexOf(Object elem) |
public int indexOf(Object elem) |
310 |
{ |
{ |
313 |
|
|
314 |
/** |
/** |
315 |
* Searches the vector starting at <code>index</code> for object |
* Searches the vector starting at <code>index</code> for object |
316 |
* <code>elem</code> and returns the index of the first occurence of this |
* <code>elem</code> and returns the index of the first occurrence of this |
317 |
* Object. If the object is not found, or index is larger than the size |
* Object. If the object is not found, or index is larger than the size |
318 |
* of the vector, -1 is returned. |
* of the vector, -1 is returned. |
319 |
* |
* |
320 |
* @param e the Object to search for |
* @param e the Object to search for |
321 |
* @param index start searching at this index |
* @param index start searching at this index |
322 |
* @return the index of the next occurence, or -1 if it is not found |
* @return the index of the next occurrence, or -1 if it is not found |
323 |
* @throws IndexOutOfBoundsException if index < 0 |
* @throws IndexOutOfBoundsException if index < 0 |
324 |
*/ |
*/ |
325 |
public synchronized int indexOf(Object e, int index) |
public synchronized int indexOf(Object e, int index) |
343 |
} |
} |
344 |
|
|
345 |
/** |
/** |
346 |
* Returns the index of the first occurence of <code>elem</code>, when |
* Returns the index of the first occurrence of <code>elem</code>, when |
347 |
* searching backwards from <code>index</code>. If the object does not |
* searching backwards from <code>index</code>. If the object does not |
348 |
* occur in this Vector, or index is less than 0, -1 is returned. |
* occur in this Vector, or index is less than 0, -1 is returned. |
349 |
* |
* |