-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStagingArea.java
More file actions
34 lines (26 loc) · 790 Bytes
/
Copy pathStagingArea.java
File metadata and controls
34 lines (26 loc) · 790 Bytes
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
import java.util.*;
import java.io.Serializable;
public class StagingArea implements Serializable {
private HashMap<String, String> addedFiles;
private ArrayList<String> removedFiles;
public StagingArea() {
addedFiles = new HashMap<>();
removedFiles = new ArrayList<>();
}
public void add(String fileName, String sha1) {
addedFiles.put(fileName, sha1);
}
public void addToRemovedFiles(String fileName) {
removedFiles.add(fileName);
}
public void clear() {
addedFiles = new HashMap<>();
removedFiles = new ArrayList<>();
}
public HashMap<String, String> getAddedFiles() {
return addedFiles;
}
public ArrayList<String> getRemovedFiles() {
return removedFiles;
}
}