Here you can find the source of createVector(Object[] array)
Parameter | Description |
---|---|
array | an Object[] |
public static Vector createVector(Object[] array)
//package com.java2s; import java.util.*; public class Main { /**/* w ww. j a va 2 s .co m*/ * @return a Vector with contents of the Iterator * @param iterator the Iterator object */ public static Vector createVector(Iterator iterator) { Vector v = new Vector(); while (iterator.hasNext()) v.addElement(iterator.next()); return v; } /** * @return a Vector with contents of the List * @param iterator the Iterator object */ public static Vector createVector(List list) { return createVector(list.iterator()); } /** * @return a Vector with contents of the Enumeration * @param e the Enumeration object */ public static Vector createVector(Enumeration e) { Vector v = new Vector(); while (e.hasMoreElements()) v.addElement(e.nextElement()); return v; } /** * @return a Vector with contents of the Object[] * @param array an Object[] */ public static Vector createVector(Object[] array) { Vector v = new Vector(); for (int i = 0; i < array.length; ++i) v.addElement(array[i]); return v; } }