Converts the specified object to vector according to the following rules:
obj
is already a vector object,
(i.e. instance of java.util.Vector
),
the function works simply as the type cast operator,
same as it would be in Java: (Vector) obj
obj
is an array,
(i.e. instance of java.lang.Object[]
),
the function returns a vector containing elements of that array.
obj
is an enumeration,
(i.e. instance of java.util.Enumeration
),
the function returns a vector containing all elements provided by the enumeration.
obj
is an instance of java.util.Iterator
Java class,
the function returns a vector containing all elements provided by the iterator.
obj
is instance of java.util.Collection
Java class,
the returned vector is created as: new Vector((Collection) obj)
obj
is instance of java.util.Map
Java class,
the returned vector is created as: new Vector(((Map) obj).values())
obj
is null
, an empty vector is returned.
obj
is neither of the above, the function returns
a vector with this object as the only its element.
You may call this function in a more method-like style:
obj.toVector()