blob: 2314f58ed4ad8653947b6325fbbb20011fcc0060 (
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
|
/*
* Created on Nov 3, 2009
*
* PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
*/
package org.eclipse.osee.coverage.merge;
import java.util.Collection;
import org.eclipse.osee.coverage.model.ICoverage;
/**
* @author Donald G. Dunne
*/
public class MatchItem {
private final MatchType matchType;
private final ICoverage packageItem;
private final ICoverage importItem;
public static MatchItem No_Match_Item = new MatchItem(MatchType.No_Match__Name_Or_Order_Num, null, null);
public MatchItem(MatchType matchType, ICoverage packageItem, ICoverage importItem) {
this.matchType = matchType;
this.packageItem = packageItem;
this.importItem = importItem;
}
public MatchType getMatchType() {
return matchType;
}
public ICoverage getPackageItem() {
return packageItem;
}
public ICoverage getImportItem() {
return importItem;
}
@Override
public String toString() {
return "Match Type>> " + matchType.toString() + " - Import Item>>" + importItem.toString() + ") - Package Item>>(" + (packageItem != null ? packageItem.toString() : "[null])");
}
public static boolean isAllMatchType(Collection<MatchType> matchTypes, Collection<MatchItem> matchItems) {
for (MatchItem matchItem : matchItems) {
if (!matchTypes.contains(matchItem.getMatchType())) {
return false;
}
}
return true;
}
public boolean isMatch() {
if (matchType.toString().startsWith("Match__")) {
return true;
}
return false;
}
public boolean isMatchType(Collection<MatchType> matchTypes) {
if (!matchTypes.contains(matchType)) {
return false;
}
return true;
}
}
|