Hi. I've to create a table or an array list in memory, other applets will be writing to it and updating it. The records in the table will eventually be flushed to database. Currently I am using String in an applet to hold these data, but everytime another applet calls this singleton, it flushes all the old data and start from scratch i.e. index at 0. Can someone suggest some workable solution on how to create and update a table in memory please. TIA :-)
Have you looked at the Collections classes in java.util? For example there is java.util.HashTable, java.util.HashSet (Which is a Hash Table implementation that uses a Set Interface) and java.util.HashMap (which is a hash table based implementation of the Map interface). Take a look at the Sun API or another resource on the Collection classes.
Joined: Jul 29, 2002
I hope they allow multiple applets to update and insert into them without flushing the old data and resetting the index everytime an applet accesses it? Thanks for the tip.
Joined: Jan 29, 2003
Just curious ... how did you store your array in memory so that "other applets" can get to it? What does the code look like that gets a reference to the array? Maybe you're inadvertantly creating a new table every time through.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi