bhession
asked on
An alternative to the Vector container
Ok I have been using Vector arrays for storing data objects. Inserting them and recalling them from a database for example. I believe vectors have a limit of something like 900 entries allowed in them. A problem I forsee in the future. So to this end I need an alternative container. Any suggestions?
Take a look at ArrayList
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yeh, I'd never heard about the max size issue either tbh. ArrayList was just an alternative to Vector. There is a whole bunch of classes in the collections package that might be of use to you. You might also want to consider a custom data structure, depending on your usage.
ASKER
Ok can you point me to a good place to learn how to use this array list. Also as I am pulling from a very large database maybe 100,000 rows should I be concerned by using an ArrayList?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... plus pulling 100,000 from your database is going to grind it to a halt, nevermind your application logic.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry enachemc, could you expand on the below so I could better understand what you mean.
"no_of_items should exceed the required capacity (otherwise, ArrayList will expand its size, but at a cost of slowing you down a tiny bit)"
I'm unsure as to what your saying. Thanks
"no_of_items should exceed the required capacity (otherwise, ArrayList will expand its size, but at a cost of slowing you down a tiny bit)"
I'm unsure as to what your saying. Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that is true
so ensure a correct estimate
an incorrect estimate would still work, but 0.1% slower
so ensure a correct estimate
an incorrect estimate would still work, but 0.1% slower
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.