A
andrewzzz
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);
}
}
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);
}
}