Re: Vector Storing
- From: DrChaos <DrChaos@xxxxxxxxx>
- Date: Wed, 31 Jan 2007 17:23:36 GMT
I don't know what the issue here is with not understanding your simple question.
Let me help moderate.
Andrew has some java program where on construction of A class in the program data is added to a Vector.
You follow so far yes? the data is irrelevant at this point.
When the class is killed/ program exits.. I believe he wants that data in the vector to be "saved" likely to disk?
I'd suggest (without knowing the 'data') to look into "Serializable" classes for the data you are adding to the vector.. unless its just a string or otherwise simple type.
before exit of your program you would likely preform some loop through your vector and initiate the write to disk.
But I'm sure, with more information this java newsgroup can figure out a nice smooth way to deal with your little issue.
-DrChaos
andrewzzz wrote:
In a class I have to store and mantain a Vector object..
I can declare it as static, but anyway to access it I have to
initialize the Vector (new Vector()) ... so everytime I create a new
instance of this class I lose my data(??).
actual :
private static Vector dynvector;
in the constructor :
dynvector=new Vector;
dynvector.add(de);//add de to the end of the vector
What should I do to save the content of a vector ???
- References:
- Vector Storing
- From: andrewzzz
- Vector Storing
- Prev by Date: Re: Sorting a vector based on another datas
- Next by Date: Re: 2D lookup table
- Previous by thread: Re: Vector Storing
- Next by thread: Re: Vector Storing
- Index(es):
Relevant Pages
|