F
f
In my project, I need to write a lot of class like:
public class Data1{
double d1;
double d2;
double getD1(){
return d1;
}
double getD2(){
return d2;
}
}
public class data2{
int g1;
int g2;
int g3;
int getG1(){
return g1;
}
int getG2(){
return g2;
}
int getG3(){
return g3;
}
}
public class data3{
short aaa1;
short getAAA1(){
return aaa1;
}
}
I need to write a huge collection of code which have very clear
patterns. I am wondering if there is a tool to automatically generate
the code. For example, I write a template:
public class <<class_name>>{
<<LOOP>>
<<data_type>> <<data_name>>;
<<END_LOOP>>
<<LOOP>>
<<data_type>> get<<data_name>>(){
return <<data_name>>;
};
};
and the tool can generate the java source code for me?
Thanks,
ff
public class Data1{
double d1;
double d2;
double getD1(){
return d1;
}
double getD2(){
return d2;
}
}
public class data2{
int g1;
int g2;
int g3;
int getG1(){
return g1;
}
int getG2(){
return g2;
}
int getG3(){
return g3;
}
}
public class data3{
short aaa1;
short getAAA1(){
return aaa1;
}
}
I need to write a huge collection of code which have very clear
patterns. I am wondering if there is a tool to automatically generate
the code. For example, I write a template:
public class <<class_name>>{
<<LOOP>>
<<data_type>> <<data_name>>;
<<END_LOOP>>
<<LOOP>>
<<data_type>> get<<data_name>>(){
return <<data_name>>;
};
};
and the tool can generate the java source code for me?
Thanks,
ff