|
@@ -1,18 +1,31 @@
|
1
|
1
|
package rocks.zipcode.io.quiz4.generics;
|
2
|
2
|
|
|
3
|
+
|
|
4
|
+import java.util.Collections;
|
|
5
|
+
|
3
|
6
|
/**
|
4
|
7
|
* @author leon on 18/12/2018.
|
5
|
8
|
*/
|
6
|
9
|
public class SortedGroup<_> extends Group<_> {
|
|
10
|
+
|
|
11
|
+
|
7
|
12
|
@Override
|
8
|
13
|
public void insert(Object value) {
|
|
14
|
+ myGroup.add((_)value);
|
|
15
|
+ Collections.sort(myGroup,null );
|
|
16
|
+
|
|
17
|
+
|
9
|
18
|
}
|
10
|
19
|
|
11
|
20
|
@Override
|
12
|
21
|
public void delete(Object value) {
|
|
22
|
+ myGroup.remove((_)value);
|
|
23
|
+
|
|
24
|
+
|
13
|
25
|
}
|
14
|
26
|
|
15
|
27
|
public Integer indexOf(_ firstValue) {
|
16
|
|
- return null;
|
|
28
|
+
|
|
29
|
+ return myGroup.indexOf(firstValue);
|
17
|
30
|
}
|
18
|
31
|
}
|