Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

Vector

Thread view: 
andrewzzz - 28 Jan 2007 15:12 GMT
Hi guys,
I have to use a Vector object to store a growable array of objects,but
I have an implementative question :
I have to create the Vector only the first time the class cointaining
it will be extecuted , then I have to add elements ,
without deleting old entries , and creating new instances of the
class :
Here is my actual simple code , that I think will delete all my
entries every time the class is executed.
Another question : after deserializing a class ,  I need to
instanciate it?
Thanks a lot guys!!! bytebye
(please note that I'm obliged to use Vector..)

public class AgentMessage implements Serializable{
    private static final long serialVersionUID = 1L;
    transient private StaticPart sp;//per metodo get
    transient private DynElement de;

    private Vector  dynvector;

    public AgentMessage(String agent,byte[] code,String
mainclass,Certificate signerId,PrivateKey priv,String
configuration,Serializable dclear,byte[] dsecret,PathEl[] dpath,byte[]
c){

        sp=new
StaticPart(agent,code,mainclass,signerId,priv,configuration);
        de=new DynElement(dclear,dsecret,c,dpath);//deve diventare vector

        dynvector=new Vector();/
        dynvector.add(de);

    }

}
Andrew Thompson - 28 Jan 2007 15:38 GMT
...
> I have to use a Vector object to store a growable array of objects,but
> I have an implementative question :
[quoted text clipped - 5 lines]
> entries every time the class is executed.
> Another question :

No.  Actually you have made a number of
statements, but asked no question, up to
this point.

>...after deserializing a class ,  I need to
> instanciate it?

No.  Serialized data comes back as *objects*
of the classes that were serialized.  If you
had to instantiate the class, and repopulate
the attributes, it would make the process of
serialisation/deserialisation pointless.

> Thanks a lot guys!!! bytebye
> (please note that I'm obliged to use Vector..)

Please note that a student doing their thesis,
is usually supposed to have enough clarity of
thought to know when they are asking a question,
and some of that clarity of thought might be well
put to thinking of better thread titles than
'Vector' and 'Sinature'.  Perhaps
'Vector use and serialisation' &
'Sign code with public key'?

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.