1
2
3
4
5 package de.tud.plt.r43ples.optimization;
6
7 import de.tud.plt.r43ples.existentobjects.ChangeSet;
8 import de.tud.plt.r43ples.existentobjects.Revision;
9 import de.tud.plt.r43ples.existentobjects.RevisionGraph;
10 import org.apache.logging.log4j.LogManager;
11 import org.apache.logging.log4j.Logger;
12
13 import java.util.LinkedList;
14
15 public class ChangeSetPath {
16
17
18
19
20 private Logger logger = LogManager.getLogger(ChangeSetPath.class);
21
22
23
24
25 private Revision startRevision;
26
27
28
29 private Revision targetRevision;
30
31
32
33 private LinkedList<ChangeSet> changeSets;
34
35
36
37
38 private RevisionGraph revisionGraph;
39
40
41
42
43
44
45
46
47
48 public ChangeSetPath(RevisionGraph revisionGraph, Revision startRevision, Revision targetRevision) {
49 this.revisionGraph = revisionGraph;
50
51 this.startRevision = startRevision;
52 this.targetRevision = targetRevision;
53
54 changeSets = new LinkedList<>();
55 }
56
57
58
59
60
61
62 public void addRevisionToPathEnd(ChangeSet changeSet) {
63 changeSets.add(changeSet);
64 }
65
66
67
68
69
70
71 public void addRevisionToPathStart(ChangeSet changeSet) {
72 changeSets.addFirst(changeSet);
73 }
74
75
76
77
78
79
80 public LinkedList<ChangeSet> getRevisionPath() {
81 return changeSets;
82 }
83
84 public Revision getTargetRevision() {
85 return targetRevision;
86 }
87
88 public Revision getStartRevision() {
89 return startRevision;
90 }
91 }