1
|
package data;
|
2
|
|
3
|
/**
|
4
|
*
|
5
|
* Třída JDFCaskodyRecord obsahuje jeden záznam načtených dat z Caskody.txt
|
6
|
*-issue #7315
|
7
|
* @author Daniel Stus, Marek Sobota, Lukas Scurko, Jan Jirman
|
8
|
* @version 1.0
|
9
|
*/
|
10
|
public class JDFCaskodyRecord implements IProcessable {
|
11
|
|
12
|
//-------------- Konstanty -------------//
|
13
|
|
14
|
/** konstanta indexu: numberLine */
|
15
|
private final int numberLineIndex = 0;
|
16
|
/** konstanta indexu: numberJoin */
|
17
|
private final int numberJoinIndex = 1;
|
18
|
/** konstanta indexu: numberTimeCode */
|
19
|
private final int numberTimeCodeIndex = 2;
|
20
|
/** konstanta indexu: timeCode */
|
21
|
private final int timeCodeIndex = 3 ;
|
22
|
/** konstanta indexu: typeTimeCode */
|
23
|
private final int typeTimeCodeIndex = 4;
|
24
|
/** konstanta indexu: startDate */
|
25
|
private final int startDateIndex = 5;
|
26
|
/** konstanta indexu: endDate */
|
27
|
private final int endDateIndex = 6;
|
28
|
|
29
|
//-------------- Atributy --------------/
|
30
|
private String numberLine;
|
31
|
private String numberJoin;
|
32
|
private String numberTimeCode;
|
33
|
private String timeCode;
|
34
|
private String typeTimeCode;
|
35
|
private String startDate;
|
36
|
private String endDate;
|
37
|
|
38
|
//-------------- Konstruktor -------------/
|
39
|
|
40
|
/**
|
41
|
* Konstruktor JDFCaskodyRecord, který vytvoří jeden záznam z caskody v JDF
|
42
|
* @param dataRecord jeden záznam načtených dat
|
43
|
*/
|
44
|
public JDFCaskodyRecord(String[] dataRecord){
|
45
|
proccesData(dataRecord);
|
46
|
}
|
47
|
|
48
|
//----------------- Metody ----------------/
|
49
|
|
50
|
/**
|
51
|
* Metoda vrátí cislo linky
|
52
|
* @return cislo linky
|
53
|
*/
|
54
|
public String getNumberLine() {
|
55
|
return numberLine;
|
56
|
}
|
57
|
|
58
|
/**
|
59
|
* Metoda vrátí cislo spoje
|
60
|
* @return cislo spoje
|
61
|
*/
|
62
|
public String getNumberJoin() {
|
63
|
return numberJoin;
|
64
|
}
|
65
|
|
66
|
/**
|
67
|
* Metoda vrátí cislo casoveho kodu
|
68
|
* @return cislo casoveho kodu
|
69
|
*/
|
70
|
public String getNumberTimeCode() {
|
71
|
return numberTimeCode;
|
72
|
}
|
73
|
|
74
|
/**
|
75
|
* Metoda vrátí casovy kod
|
76
|
* @return casovy kod
|
77
|
*/
|
78
|
public String getTimeCode() {
|
79
|
return timeCode;
|
80
|
}
|
81
|
|
82
|
/**
|
83
|
* Metoda vrátí typ casoveho kodu
|
84
|
* @return typ casoveho kodu
|
85
|
*/
|
86
|
public String getTypeTimeCode() {
|
87
|
return typeTimeCode;
|
88
|
}
|
89
|
|
90
|
/**
|
91
|
* Metoda vrátí datum zacatku platnosti
|
92
|
* @return datum zacatku platnosti
|
93
|
*/
|
94
|
public String getStartDate() {
|
95
|
return startDate;
|
96
|
}
|
97
|
|
98
|
/**
|
99
|
* Metoda vrátí datum konce platnosti
|
100
|
* @return datum konce platnosti
|
101
|
*/
|
102
|
public String getEndDate() {
|
103
|
return endDate;
|
104
|
}
|
105
|
|
106
|
/**
|
107
|
* V metodě se přečte jeden záznam dat a rozřadí do určitých atributů - atributy bude možné dále využívat
|
108
|
* -issue #7319
|
109
|
* @param dataRecord jeden záznam načtených dat
|
110
|
*/
|
111
|
@Override
|
112
|
public void proccesData(String[] dataRecord) {
|
113
|
for(int index = 0;index<=dataRecord.length;index++){
|
114
|
switch(index){
|
115
|
case numberLineIndex:
|
116
|
this.numberLine = dataRecord[index];
|
117
|
break;
|
118
|
case numberJoinIndex:
|
119
|
this.numberJoin = dataRecord[index];
|
120
|
break;
|
121
|
case numberTimeCodeIndex:
|
122
|
this.numberTimeCode = dataRecord[index];
|
123
|
break;
|
124
|
case timeCodeIndex:
|
125
|
this.timeCode = dataRecord[index];
|
126
|
break;
|
127
|
case typeTimeCodeIndex:
|
128
|
this.typeTimeCode = dataRecord[index];
|
129
|
break;
|
130
|
case startDateIndex:
|
131
|
this.startDate = dataRecord[index];
|
132
|
break;
|
133
|
case endDateIndex:
|
134
|
this.endDate = dataRecord[index];
|
135
|
break;
|
136
|
}
|
137
|
}
|
138
|
}
|
139
|
}
|