Repository navigation
Expand file tree
/
Copy pathFoititis.java
More file actions
59 lines (49 loc) · 1.5 KB
/
Copy pathFoititis.java
File metadata and controls
59 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.util.Date;
import java.text.*;
//import MyDateLib.java;
public class Foititis {
private static int auxwnArithmos = 0;
private String AM;
private String onomatEpwnymo;
private Date hmeromGennisis;
public Foititis(int etos, String onomatEpwnymo, Date hmeromGennisis) {
auxwnArithmos+=1;
// Δημιουργία αριθμού 3 ψηφίων
DecimalFormat myFormatter = new DecimalFormat("000");
String tempArithm = myFormatter.format(auxwnArithmos);
this.AM= (etos + tempArithm);
this.onomatEpwnymo = onomatEpwnymo;
this.hmeromGennisis = hmeromGennisis;
}
public String toString() {
StringBuffer sb = new StringBuffer(this.AM + " ");
sb.append(this.onomatEpwnymo + " ");
sb.append(dateToStr(this.hmeromGennisis));
return sb.toString();
}
private String dateToStr(Date hmeromGennisis) {
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
String str = df.format(this.hmeromGennisis);
return str;
}
String getAM()
{
return this.AM;
}
String getOnEp()
{
return this.onomatEpwnymo;
}
Date getHmerom()
{
return this.hmeromGennisis;
}
public void setHmerom(Date hmerom)
{
this.hmeromGennisis=hmerom;
}
public void setOnEp(String OnEp)
{
this.onomatEpwnymo=OnEp;
}
}