![]() ![]() In this vector are incompatible with the specified (all other elements are removed) Returns: true if this Vector changed as a result of the call Throws: ClassCastException - if the types of one or more elements Specified by: retainAll in interface Collection Specified by: retainAll in interface List Overrides: retainAll in class AbstractCollection Parameters: c - a collection of elements to be retained in this Vector Of its elements that are not contained in the specified Collection. In other words, removes from this Vector all Retains only the elements in this Vector that are contained in the Of the runtime type of every element in this Vector NullPointerException - if the given array is null Since: 1.2 Returns: an array containing the elements of the Vector Throws: ArrayStoreException - if the runtime type of a is not a supertype Same runtime type is allocated for this purpose. Of the Vector only if the caller knows that the Vectorĭoes not contain any null elements.) Specified by: toArray in interface Collection Specified by: toArray in interface List Overrides: toArray in class AbstractCollection Parameters: a - the array into which the elements of the Vector are toīe stored, if it is big enough otherwise, a new array of the (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. Use is subject to license terms and the documentation redistribution policy.The Vector class implements a growable array of Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.Ĭopyright © 1993, 2022, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.Īll rights reserved. All rights reserved.įor further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. The Java Platform, Standard Edition API Specification.Īnnotated outline of the classes and interfaces comprising theĬollections framework, with links into the API Specification.įrequently asked questions (FAQ) about the design of theĬopyright © 1998, 2017, Oracle and/or its affiliates. The documents in this section are non-normative portions of Includes implementations of these interfaces and algorithms to Theįramework is based on more than a dozen collection interfaces. ItĮnables interoperability among unrelated APIs, reduces effort inĭesigning and learning new APIs, and fosters software reuse. It reduces programming effort while increasing performance. Manipulated independently of the details of their representation. Representing and manipulating collections, enabling them to be The collections framework is a unified architecture for ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |