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
|
/*
* Created on Apr 5, 2012
*
* PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
*/
package org.eclipse.osee.coverage.model;
import org.eclipse.osee.framework.jdk.core.util.GUID;
public class CoverageUnitFactory {
public static CoverageUnit createCoverageUnit(ICoverage parent, String name, String location, ICoverageUnitFileContentsProvider coverageUnitFileContentsProvider) {
return createCoverageUnit(GUID.create(), parent, name, location, coverageUnitFileContentsProvider);
}
public static CoverageUnit createCoverageUnit(String guid, ICoverage parent, String name, String location, ICoverageUnitFileContentsProvider coverageUnitFileContentsProvider) {
return createCoverageUnit(GUID.create(), parent, name, location, coverageUnitFileContentsProvider, true);
}
public static CoverageUnit createCoverageUnit(String guid, ICoverage parent, String name, String location, ICoverageUnitFileContentsProvider coverageUnitFileContentsProvider, boolean addToParent) {
CoverageUnit unit = new CoverageUnit(guid, parent, name, location, coverageUnitFileContentsProvider);
if (addToParent) {
if (parent != null && parent instanceof ICoverageUnitProvider) {
((ICoverageUnitProvider) parent).addCoverageUnit(unit);
}
}
return unit;
}
}
|