Converts the specified object to an enumeration according to the following rules:
obj
is already an enumeration object
(i.e. instance of java.util.Enumeration
),
the function works simply as the type cast operator,
same as it would be in Java: (Enumeration) obj
obj
is a vector or an array, the function returns
the enumeration of its elements.
obj
is an instance of java.util.Iterator
Java class,
the function returns an enumeration of the elements provided by the iterator.
obj
is an instance of java.util.Collection
Java class,
the function returns an enumeration of the elements provided by the
iterator: ((Collection) obj).iterator()
obj
is an instance of java.util.Map
Java class,
the returned enumeration is produced from the
collection: ((Map) obj).values()
obj
is null
, an empty enumeration is returned.
obj
is neither of the above, the function returns
a single-element Enumeration containing just this object.
You may call this function in a more method-like style:
obj.toEnum()