1 | package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.LinkedList; |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | public class Match { |
---|
9 | private ArrayList<NumberSequence> matchseqs; |
---|
10 | |
---|
11 | private LinkedList<MatchOccurence> occurences; |
---|
12 | |
---|
13 | Match() { |
---|
14 | matchseqs = new ArrayList<NumberSequence>(2); |
---|
15 | occurences = new LinkedList<MatchOccurence>(); |
---|
16 | matchseqs.add(null); |
---|
17 | matchseqs.add(null); |
---|
18 | } |
---|
19 | |
---|
20 | public NumberSequence getFirstSequence() { |
---|
21 | return matchseqs.get(0); |
---|
22 | } |
---|
23 | |
---|
24 | public NumberSequence getSecondSequence() { |
---|
25 | return matchseqs.get(1); |
---|
26 | } |
---|
27 | |
---|
28 | public void setFirstSequence(NumberSequence seq) { |
---|
29 | matchseqs.set(0, seq); |
---|
30 | } |
---|
31 | |
---|
32 | public void setSecondSequence(NumberSequence seq) { |
---|
33 | matchseqs.set(1, seq); |
---|
34 | } |
---|
35 | |
---|
36 | public void addOccurence(MatchOccurence occurence) { |
---|
37 | occurences.add(occurence); |
---|
38 | } |
---|
39 | |
---|
40 | public int occurenceCount() { |
---|
41 | return occurences.size(); |
---|
42 | } |
---|
43 | |
---|
44 | public boolean equals(Match m) { |
---|
45 | if ((m.getFirstSequence().equals(this.getFirstSequence()) || m |
---|
46 | .getFirstSequence().equals(this.getSecondSequence())) |
---|
47 | && (m.getSecondSequence().equals(this.getFirstSequence()) || m |
---|
48 | .getSecondSequence().equals(this.getSecondSequence()))) { |
---|
49 | return true; |
---|
50 | } |
---|
51 | return false; |
---|
52 | } |
---|
53 | |
---|
54 | public LinkedList<MatchOccurence> getOccurences() { |
---|
55 | return occurences; |
---|
56 | } |
---|
57 | |
---|
58 | public void setOccurences(LinkedList<MatchOccurence> occurences) { |
---|
59 | this.occurences = occurences; |
---|
60 | } |
---|
61 | |
---|
62 | /* |
---|
63 | public void addOccurencesOf(Match m) { |
---|
64 | LinkedList<MatchOccurence> occ = m.getOccurences(); |
---|
65 | occurences.addAll(occ); |
---|
66 | } |
---|
67 | */ |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | } |
---|