File: /Users/shatabdi/Education/GitHub/se450_project/src/model/others/TrackShape.java
1 package model.others;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import model.interfaces.IShape;
7
8 public class TrackShape {
9 private final List<IShape> shapes = new ArrayList<>();
10
11 public void add(IShape item) {
12
13 if (!shapes.contains(item)) {
14 shapes.add(item);
15 }
16 }
17
18 public void addAll(List<IShape> list) {
19 shapes.addAll(list);
20 }
21
22 public void clear() {
23 shapes.clear();
24 }
25
26 public boolean contains(IShape item) {
27 return shapes.contains(item);
28 }
29
30 public IShape get(int index) {
31 return shapes.get(index);
32 }
33
34 public List<IShape> getList() {
35 return shapes;
36 }
37
38 public void remove(IShape item) {
39 shapes.remove(item);
40 }
41
42 public void removeAll(List<IShape> list) {
43 shapes.removeAll(list);
44 }
45
46
47 }
48