Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting objects in a vector to array of primitives

Status
Not open for further replies.

kmcculler

Programmer
Jul 5, 2000
81
US
Situation: I've got a Vector full of Double (object) numbers that I need to pass to a charting module witch only accepts an array of primitive doubles.
Question: Is there any better way to create a double[] from my Vector than to move through each element of it and build an array step by step? Kris McCuller
Programmer Portiva Corp.
kmcculler@portiva.com
 
Hi,

I do not think there is anything elegant.

May be you should reconsider things from scratch
and whenever you populate a vector with Double wrappers
just populate an array of primitive doubles.
Keep in mind that arrays in Java can be created dynamically
and many standard classes, Vector including, use this
approach.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top