- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
private String getNullString(int kol){
String nullstr="";
for(int i=0;i<kol;i++){
nullstr+="0";
}
return nullstr;
}
public String getNumber(int idd){
String regid="";
String idds=(idd+"");
if(idds.length()<getNumberLenth()){
regid+=getNullString(getNumberLenth()-idds.length());
regid+=idds;
}
String regnum="";
regnum+=getNumberPrefix()+regid;
if(getNumberPeriod()!=NUM_PERIOD_NOPERIOD){
GregorianCalendar c=new GregorianCalendar();
switch(getNumberPeriod()){
case NUM_PERIOD_MONTH:
int m=c.get(Calendar.MONTH)+1;
regnum+="-"+m;
regnum+=".";
regnum+=c.get(Calendar.YEAR);
break;
case NUM_PERIOD_YEAR:
regnum+="-"+c.get(Calendar.YEAR);
}
}
return regnum;
}