Skip to content

Commit 12d5974

Browse files
author
Gerrit Garbereder
committed
Add Activity Collection
1 parent 0af790a commit 12d5974

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.garbereder.tasktracker.entities
2+
3+
class ActivityCollectionImpl : ActivityCollection {
4+
5+
private val list = mutableListOf<Activity>()
6+
override fun add(activity: Activity) {
7+
list.add(activity)
8+
}
9+
10+
override fun iterator(): Iterator<Activity> = list.iterator()
11+
12+
override fun remove(activity: Activity) {
13+
if (!list.contains(activity))
14+
throw ActivityNotFoundException(activity)
15+
list.remove(activity)
16+
}
17+
18+
}

0 commit comments

Comments
 (0)