Sdílet prostřednictvím


Vector.SetElementAt(Object, Int32) Method

Definition

Sets the component at the specified index of this vector to be the specified object.

[Android.Runtime.Register("setElementAt", "(Ljava/lang/Object;I)V", "GetSetElementAt_Ljava_lang_Object_IHandler")]
public virtual void SetElementAt (Java.Lang.Object? obj, int index);
[<Android.Runtime.Register("setElementAt", "(Ljava/lang/Object;I)V", "GetSetElementAt_Ljava_lang_Object_IHandler")>]
abstract member SetElementAt : Java.Lang.Object * int -> unit
override this.SetElementAt : Java.Lang.Object * int -> unit

Parameters

obj
Object

what the component is to be set to

index
Int32

the specified index

Attributes

Remarks

Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded.

The index must be a value greater than or equal to 0 and less than the current size of the vector.

This method is identical in functionality to the #set(int, Object) set(int, E) method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position.

Java documentation for java.util.Vector.setElementAt(E, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to