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
|
/** konstanta indexu: numberLineVersion */
|
29
|
private final int numberLineVersionIndex = 8;
|
30
|
|
31
|
//-------------- Atributy --------------/
|
32
|
private String numberLine;
|
33
|
private String numberJoin;
|
34
|
private String numberTimeCode;
|
35
|
private String timeCode;
|
36
|
private String typeTimeCode;
|
37
|
private String startDate;
|
38
|
private String endDate;
|
39
|
private String numberLineVersion;
|
40
|
|
41
|
//-------------- Konstruktor -------------/
|
42
|
|
43
|
/**
|
44
|
* Konstruktor JDFCaskodyRecord, který vytvoří jeden záznam z caskody v JDF
|
45
|
* @param dataRecord jeden záznam načtených dat
|
46
|
*/
|
47
|
public JDFCaskodyRecord(String[] dataRecord){
|
48
|
proccesData(dataRecord);
|
49
|
}
|
50
|
|
51
|
//----------------- Metody ----------------/
|
52
|
|
53
|
/**
|
54
|
* Metoda vrátí cislo linky
|
55
|
* @return cislo linky
|
56
|
*/
|
57
|
public String getNumberLine() {
|
58
|
return numberLine;
|
59
|
}
|
60
|
|
61
|
/**
|
62
|
* Metoda vrátí cislo spoje
|
63
|
* @return cislo spoje
|
64
|
*/
|
65
|
public String getNumberJoin() {
|
66
|
return numberJoin;
|
67
|
}
|
68
|
|
69
|
/**
|
70
|
* Metoda vrátí cislo casoveho kodu
|
71
|
* @return cislo casoveho kodu
|
72
|
*/
|
73
|
public String getNumberTimeCode() {
|
74
|
return numberTimeCode;
|
75
|
}
|
76
|
|
77
|
/**
|
78
|
* Metoda vrátí casovy kod
|
79
|
* @return casovy kod
|
80
|
*/
|
81
|
public String getTimeCode() {
|
82
|
return timeCode;
|
83
|
}
|
84
|
|
85
|
/**
|
86
|
* Metoda vrátí typ casoveho kodu
|
87
|
* @return typ casoveho kodu
|
88
|
*/
|
89
|
public String getTypeTimeCode() {
|
90
|
return typeTimeCode;
|
91
|
}
|
92
|
|
93
|
/**
|
94
|
* Metoda vrátí datum zacatku platnosti
|
95
|
* @return datum zacatku platnosti
|
96
|
*/
|
97
|
public String getStartDate() {
|
98
|
return startDate;
|
99
|
}
|
100
|
|
101
|
/**
|
102
|
* Metoda vrátí datum konce platnosti
|
103
|
* @return datum konce platnosti
|
104
|
*/
|
105
|
public String getEndDate() {
|
106
|
return endDate;
|
107
|
}
|
108
|
|
109
|
/**
|
110
|
* Metoda vrátí cislo verze linky
|
111
|
* @return cislo verze linky
|
112
|
*/
|
113
|
public String getNumberLineVersion() {
|
114
|
return numberLineVersion;
|
115
|
}
|
116
|
|
117
|
/**
|
118
|
* 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
|
119
|
* -issue #7319
|
120
|
* @param dataRecord jeden záznam načtených dat
|
121
|
*/
|
122
|
@Override
|
123
|
public void proccesData(String[] dataRecord) {
|
124
|
for(int index = 0;index<=dataRecord.length;index++){
|
125
|
switch(index){
|
126
|
case numberLineIndex:
|
127
|
this.numberLine = dataRecord[index];
|
128
|
break;
|
129
|
case numberJoinIndex:
|
130
|
this.numberJoin = dataRecord[index];
|
131
|
break;
|
132
|
case numberTimeCodeIndex:
|
133
|
this.numberTimeCode = dataRecord[index];
|
134
|
break;
|
135
|
case timeCodeIndex:
|
136
|
this.timeCode = dataRecord[index];
|
137
|
break;
|
138
|
case typeTimeCodeIndex:
|
139
|
this.typeTimeCode = dataRecord[index];
|
140
|
break;
|
141
|
case startDateIndex:
|
142
|
this.startDate = dataRecord[index];
|
143
|
break;
|
144
|
case endDateIndex:
|
145
|
this.endDate = dataRecord[index];
|
146
|
break;
|
147
|
case numberLineVersionIndex:
|
148
|
this.numberLineVersion = dataRecord[index];
|
149
|
break;
|
150
|
}
|
151
|
}
|
152
|
}
|
153
|
}
|