1 package ca.uhn.hl7v2.model;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6
7
8
9
10
11
12
13 @SuppressWarnings("serial")
14 public class GenericComposite extends AbstractComposite {
15
16 private final List<Type> components;
17 private final Message message;
18
19
20
21
22
23
24 public GenericComposite(Message message) {
25 super(message);
26 this.message = message;
27 components = new ArrayList<>(20);
28 }
29
30
31
32
33
34 public Type getComponent(int number) {
35 for (int i = components.size(); i <= number; i++) {
36 components.add(new Varies(message));
37 }
38 return components.get(number);
39 }
40
41
42
43
44 public Type[] getComponents() {
45 return components.toArray(new Type[0]);
46 }
47
48
49 public String getName() {
50 return "UNKNOWN";
51 }
52
53
54 }