(This is useful in determining the length The element in the array immediately following the end of the (i.e., the array has more elements than the Vector), If the Vector fits in the specified array with room to spare Type of the specified array and the size of this Vector. Otherwise, a new array is allocated with the runtime If the Vector fits in the specified array, it is Returns an array containing all of the elements in this Vector in theĬorrect order the runtime type of the returned array is that of the Implementation is not needed, it is recommended to use ArrayList in place of Vector. Implement the List interface, making it a member of the Therefore, it would be wrong to write a program that depended on thisĮxception for its correctness: the fail-fast behavior of iteratorsĪs of the Java 2 platform v1.2, this class was retrofitted to Throw ConcurrentModificationException on a best-effort basis. Presence of unsynchronized concurrent modification. Note that the fail-fast behavior of an iterator cannot be guaranteedĪs it is, generally speaking, impossible to make any hard guarantees in the Than risking arbitrary, non-deterministic behavior at an undetermined Thus, in the face ofĬoncurrent modification, the iterator fails quickly and cleanly, rather If the vector is structurally modified at any time after the iterator isĬreated, in any way except through the iterator's ownĬoncurrentModificationException. The iterators returned by this class's iterator and An application can increase theĬapacity of a vector before inserting a large number ofĬomponents this reduces the amount of incremental reallocation. Vector, the vector's storage increases in chunks the size ofĬapacityIncrement. Size it is usually larger because as components are added to the Vector can grow or shrink as needed to accommodateĪdding and removing items after the Vector has been created.Įach vector tries to optimize storage management by maintaining aĬapacity is always at least as large as the vector Like an array, it contains components that can beĪccessed using an integer index. The Vector class implements a growable array of
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |