Closed ghost closed 1 year ago
Most collection classes allow one to access values (and keys) via vectors. The Vector
class has a ToArray()
method. Could you tell me if you're referring to a specific collection class? For example, the List
class does not provide vector access by design.
I get the idea from Java. Almost all of the Collections I know on Java have a .toArray()
method.
Ok, I got it. Not sure how useful that is for classes like List
, Queue
, Stack
, Cache
, etc. I will tag this as an enhancement.
Ok, I got it. Not sure how useful that is for classes like
List
,Queue
,Stack
,Cache
, etc. I will tag this as an enhancement.
You could consult the Java document by Oracle. It seems almost all Collections have a .toArray()
method. For example: https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html (scroll down and you will see toArray
listed on methods). Btw, I don't see Java has any Cache
class as part of their Collections
.
Added ToArray()
method to the List
, Queue
, and Stack
classes. All other classes allow access to key/value vectors. Vectors can be converted to arrays also using their ToArray()
method.
Currently, only Vector has
->ToArray()
method.