1.ArrayList Method Summary
Construction Method Summary ArrayList () constructs an empty list with an initial capacity of 10. ArrayList (collection<? extends e> c) constructs a list of elements that contain the specified Collection, arranged in the order in which they are returned by the Collection iterator. ArrayList (int initialcapacity) constructs an empty list with the specified initial capacity. Method Summary Booleanadd (e) Adds the specified element to the tail of this list. Voidadd (int index, E Element) inserts the specified element into the specified position in this list. Booleanaddall (collection<? extends e> c) adds all elements in the Collection to the end of this list, in the order of the elements returned by the specified Collection iterator. Booleanaddall (int index, COLLECTION<? extends e> c) Inserts all elements from the specified Collection into this list, starting at the specified location. Voidclear () Removes all elements from this list. Objectclone () returns a shallow copy of this ArrayList instance. Booleancontains (Object o) returns true if the specified element is contained in this list. voidensurecapacity (int mincapacity), if necessary, increase the capacity of this ArrayList instance to ensure that it can at least accommodate the number of elements specified by the minimum capacity parameter. Eget (int index) returns the element at the specified position in this list. Intindexof (Object o) returns the index of the specified element that first appeared in this list, or 1 if the list does not contain elements. Booleanisempty () returns True if no element is present in this list intlastindexof (Object o) returns the last specified element in this listThe index of the vegetarian, or 1 if the list does not contain an index. Eremove (int index) removes the element at the specified position in this list. Booleanremove (Object o) removes the specified element (if any) that first appears in this list. protected Voidremoverange (int fromIndex, int toindex) removes all elements in the list between FromIndex (inclusive) and Toindex (not included). Eset (int index, E Element) replaces the element at the specified position in this list with the specified element. Intsize () returns the number of elements in this list. Object[]toarray () returns an array containing all the elements in this list in the appropriate order (from the first to the last element). <T> T[]toarray (t[] a) returns an array containing all the elements in this list in the appropriate order (from first to last); The run-time type of the returned array is the run-time type of the specified array. Voidtrimtosize () Adjusts the capacity of this ArrayList instance to the current size of the list.
2.js realizes some functions
JS realizes ArrayList function