summaryrefslogtreecommitdiffstats
path: root/src/org/uic/barcode/ticket/api/impl/SimpleUicRailTicket.java
blob: 708cd755fde7273d861ef6c046adb10e51ca7eff (plain) (blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/*
 * 
 */
package org.uic.barcode.ticket.api.impl;

import java.util.Collection;
import java.util.LinkedHashSet;

import org.uic.barcode.ticket.api.spec.ICarCarriageReservation;
import org.uic.barcode.ticket.api.spec.IControlDetail;
import org.uic.barcode.ticket.api.spec.ICounterMark;
import org.uic.barcode.ticket.api.spec.ICustomerCard;
import org.uic.barcode.ticket.api.spec.IDelayConfirmation;
import org.uic.barcode.ticket.api.spec.IDocumentData;
import org.uic.barcode.ticket.api.spec.IDocumentExtension;
import org.uic.barcode.ticket.api.spec.IExtension;
import org.uic.barcode.ticket.api.spec.IFipTicket;
import org.uic.barcode.ticket.api.spec.IIssuingDetail;
import org.uic.barcode.ticket.api.spec.IOpenTicket;
import org.uic.barcode.ticket.api.spec.IParkingGround;
import org.uic.barcode.ticket.api.spec.IPass;
import org.uic.barcode.ticket.api.spec.IReservation;
import org.uic.barcode.ticket.api.spec.IStationPassage;
import org.uic.barcode.ticket.api.spec.ITravelerDetail;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
import org.uic.barcode.ticket.api.spec.IVoucher;


/**
 * The Class SimpleUicRailTicket.
 */
public class SimpleUicRailTicket implements IUicRailTicket {
	
	/** The issuer details. */
	private IIssuingDetail issuerDetails = new SimpleIssuingDetail();
	
	/** The traveler details. */
	private ITravelerDetail travelerDetails;	
	
	/** The control details. */
	private IControlDetail controlDetails;	
		
	/** The extensions. */
	private Collection<IExtension> extensions = new LinkedHashSet<IExtension>();
	
	/** The documents. */
	private Collection<IDocumentData> documents = new LinkedHashSet<IDocumentData>();

	
	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.IUicRailTicket#getIssuerDetails()
	 */
	@Override
	public IIssuingDetail getIssuerDetails() {
		
		if (issuerDetails == null) {
			issuerDetails = new SimpleIssuingDetail();
		}
		return issuerDetails;
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.IUicRailTicket#getTravelerDetails()
	 */
	public ITravelerDetail getTravelerDetails() {
		
		if (travelerDetails == null) {
			travelerDetails = new SimpleTravelerDetail();
		}		
		return travelerDetails;
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#getControlDetails()
	 */
	public IControlDetail getControlDetails() {
		
		if (controlDetails == null) {
			controlDetails = new SimpleControlDetail();
		}			
		return controlDetails;
	}


	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#getExtensions()
	 */
	public Collection<IExtension> getExtensions() {
		return extensions;
	}


	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addExtension(org.uic.ticket.api.spec.IExtension)
	 */
	public void addExtension(IExtension extension) {
		this.extensions.add(extension);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#setIssuerDetails(org.uic.ticket.api.spec.IIssuingDetail)
	 */
	public void setIssuerDetails(IIssuingDetail issuerDetails) {
		this.issuerDetails = issuerDetails;
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#setTravelerDetails(org.uic.ticket.api.spec.ITravelerDetail)
	 */
	public void setTravelerDetails(ITravelerDetail travelerDetails) {
		this.travelerDetails = travelerDetails;
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#setControlDetails(org.uic.ticket.api.spec.IControlDetail)
	 */
	public void setControlDetails(IControlDetail controlDetails) {
		this.controlDetails = controlDetails;
	}


	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#getDocumentData()
	 */
	@Override
	public Collection<IDocumentData> getDocumentData() {
		return this.documents;
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addReservation(org.uic.ticket.api.spec.IReservation)
	 */
	@Override
	public void addReservation(IReservation document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addOpenTicket(org.uic.ticket.api.spec.IOpenTicket)
	 */
	@Override
	public void addOpenTicket(IOpenTicket document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addCarCarriageReservation(org.uic.ticket.api.spec.ICarCarriageReservation)
	 */
	@Override
	public void addCarCarriageReservation(ICarCarriageReservation document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addPass(org.uic.ticket.api.spec.IPass)
	 */
	@Override
	public void addPass(IPass document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addVoucher(org.uic.ticket.api.spec.IVoucher)
	 */
	@Override
	public void addVoucher(IVoucher document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addCustomerCard(org.uic.ticket.api.spec.ICustomerCard)
	 */
	@Override
	public void addCustomerCard(ICustomerCard document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addCounterMark(org.uic.ticket.api.spec.ICounterMark)
	 */
	@Override
	public void addCounterMark(ICounterMark document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addParkingGround(org.uic.ticket.api.spec.IParkingGround)
	 */
	@Override
	public void addParkingGround(IParkingGround document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addFipTicket(org.uic.ticket.api.spec.IFipTicket)
	 */
	@Override
	public void addFipTicket(IFipTicket document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addStationPassage(org.uic.ticket.api.spec.IStationPassage)
	 */
	@Override
	public void addStationPassage(IStationPassage document) {
		this.documents.add(document);
	}

	/* (nicht-Javadoc)
	 * @see org.uic.ticket.api.spec.IUicRailTicket#addDocumentExtension(org.uic.ticket.api.spec.IDocumentExtension)
	 */
	@Override
	public void addDocumentExtension(IDocumentExtension document) {
		this.documents.add(document);
	}

	@Override
	public void addDelayConfirmation(IDelayConfirmation document) {
		this.documents.add(document);
	}


}