1 package org.andromda.maven.plugin.andromdapp.utils;
2
3 import java.util.ArrayList;
4 import java.util.Collection;
5
6
7
8
9
10
11 public class Projects
12 {
13 private Collection<String> projects = new ArrayList<String>();
14
15
16
17
18 private static Projects instance;
19
20
21
22
23
24
25 public static Projects instance()
26 {
27 if (instance == null)
28 {
29 instance = new Projects();
30 }
31 return instance;
32 }
33
34
35
36
37
38
39 public void add(final String projectId)
40 {
41 this.projects.add(projectId);
42 }
43
44
45
46
47
48
49
50 public synchronized boolean isPresent(final String projectId)
51 {
52 return projects.contains(projectId);
53 }
54
55
56
57
58 public void clear()
59 {
60 this.projects.clear();
61 Projects.instance = null;
62 }
63 }