-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject.java
56 lines (47 loc) · 1.17 KB
/
Project.java
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
import java.util.Set;
import java.util.List;
import java.util.Vector;
import java.util.HashSet;
/**
* Write a description of class Project here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Project
{
private String name;
private Set<Task> tasks;
public Project() {
tasks = new HashSet<Task>();
}
public Project(String name) {
this.name = name;
tasks = new HashSet<Task>();
}
public String getName() {
return name;
}
public void addTask(Task task) {
//if (!tasks.contains(task)) {
tasks.add(task);
//}
}
public int calculateTimeToDelivery() {
int maxTimeToComplete = 0;
for (Task task: tasks) {
int time = task.calculateTimeToComplete();
if (time > maxTimeToComplete) {
maxTimeToComplete = time;
}
}
return maxTimeToComplete;
}
public int countTasks() {
return tasks.size();
}
public List<Task> calculateCriticalPath() {
List<Task> path = new Vector<Task>();
return path;
}
}