1111import seedu .algobase .model .problem .UniqueProblemList ;
1212import seedu .algobase .model .tag .Tag ;
1313import seedu .algobase .model .tag .UniqueTagList ;
14+ import seedu .algobase .model .task .Task ;
1415
1516/**
1617 * Wraps all data at the algobase level
@@ -32,9 +33,6 @@ public class AlgoBase implements ReadOnlyAlgoBase {
3233 {
3334 problems = new UniqueProblemList ();
3435 plans = new PlanList ();
35- }
36-
37- {
3836 tags = new UniqueTagList ();
3937 }
4038
@@ -103,7 +101,12 @@ public void removeProblem(Problem key) {
103101 problems .remove (key );
104102 }
105103
106- //// tag methods
104+ @ Override
105+ public ObservableList <Problem > getProblemList () {
106+ return problems .asUnmodifiableObservableList ();
107+ }
108+
109+ //========== Tag ====================================================================
107110 /**
108111 * Replaces the contents of the Tag list with {@code tags}.
109112 * {@code tags} must not contain duplicate tags.
@@ -112,9 +115,6 @@ public void setTags(List<Tag> tags) {
112115 this .tags .setTags (tags );
113116 }
114117
115-
116- //// tag-level operations
117-
118118 /**
119119 * Returns true if a Tag with the same identity as {@code Tag} exists in the algobase.
120120 */
@@ -140,9 +140,18 @@ public void setTag(Tag target, Tag editedTag) {
140140 requireNonNull (editedTag );
141141 tags .setTag (target , editedTag );
142142 }
143+
144+ /**
145+ * Removes {@code key} from this {@code AlgoBase}.
146+ * {@code key} must exist in the algobase.
147+ */
148+ public void removeTag (Tag key ) {
149+ tags .remove (key );
150+ }
151+
143152 @ Override
144- public ObservableList <Problem > getProblemList () {
145- return problems .asUnmodifiableObservableList ();
153+ public ObservableList <Tag > getTagList () {
154+ return tags .asUnmodifiableObservableList ();
146155 }
147156
148157 //========== Plan ===================================================================
@@ -174,16 +183,6 @@ public void setPlan(Plan target, Plan editedPlan) {
174183 plans .setPlan (target , editedPlan );
175184 }
176185
177- /**
178- * Removes {@code key} from this {@code AlgoBase}.
179- * {@code key} must exist in the algobase.
180- */
181- public void removeTag (Tag key ) {
182- tags .remove (key );
183- }
184-
185- //// util methods
186-
187186 public void removePlan (Plan key ) {
188187 plans .remove (key );
189188 }
@@ -193,6 +192,13 @@ public ObservableList<Plan> getPlanList() {
193192 return plans .asUnmodifiableObservableList ();
194193 }
195194
195+ //========== Task ===================================================================
196+
197+ @ Override
198+ public ObservableList <Task > getCurrentTaskList () {
199+ return plans .getUnmodifiableObservableTaskList ();
200+ }
201+
196202 //========== Util ===================================================================
197203
198204 @ Override
@@ -201,11 +207,6 @@ public String toString() {
201207 // TODO: refine later
202208 }
203209
204- @ Override
205- public ObservableList <Tag > getTagList () {
206- return tags .asUnmodifiableObservableList ();
207- }
208-
209210 @ Override
210211 public boolean equals (Object other ) {
211212 return other == this // short circuit if same object
0 commit comments