Seth hace 6 años
padre
commit
25bd382c57
Se han modificado 1 ficheros con 11 adiciones y 7 borrados
  1. 11
    7
      src/main/java/com/zipcodewilmington/generic/group/Group.java

+ 11
- 7
src/main/java/com/zipcodewilmington/generic/group/Group.java Ver fichero

3
 import com.zipcodewilmington.generic.identifiables.IdentifiableInterface;
3
 import com.zipcodewilmington.generic.identifiables.IdentifiableInterface;
4
 
4
 
5
 import java.io.Serializable;
5
 import java.io.Serializable;
6
+import java.util.ArrayList;
6
 import java.util.List;
7
 import java.util.List;
7
 import java.util.function.Predicate;
8
 import java.util.function.Predicate;
8
 
9
 
11
  */
12
  */
12
 public class Group<TypeOfId extends Serializable,TypeOfEntity extends IdentifiableInterface<TypeOfId>>
13
 public class Group<TypeOfId extends Serializable,TypeOfEntity extends IdentifiableInterface<TypeOfId>>
13
         extends AbstractGroup<TypeOfId, TypeOfEntity>{
14
         extends AbstractGroup<TypeOfId, TypeOfEntity>{
15
+    private List<TypeOfEntity> group = new ArrayList<>();
16
+
14
     @Override
17
     @Override
15
     public Integer count() {
18
     public Integer count() {
16
-        return null;
19
+        return group.size();
17
     }
20
     }
18
 
21
 
19
     @Override
22
     @Override
20
     public void insert(TypeOfEntity object) {
23
     public void insert(TypeOfEntity object) {
21
-
24
+        group.add(object);
22
     }
25
     }
23
 
26
 
24
     @Override
27
     @Override
25
-    public void delete(TypeOfId object) {
28
+    public void delete(TypeOfEntity object) {
29
+        group.remove(object);
26
 
30
 
27
     }
31
     }
28
 
32
 
29
     @Override
33
     @Override
30
-    public void delete(TypeOfEntity serializable) {
31
-
34
+    public void delete(TypeOfId serializable) {
35
+        group.remove(serializable);
32
     }
36
     }
33
 
37
 
34
     @Override
38
     @Override
35
     public Boolean has(TypeOfEntity object) {
39
     public Boolean has(TypeOfEntity object) {
36
-        return null;
40
+        return group.contains(object);
37
     }
41
     }
38
 
42
 
39
     @Override
43
     @Override
40
     public Boolean has(TypeOfId serializable) {
44
     public Boolean has(TypeOfId serializable) {
41
-        return null;
45
+        return group.contains(serializable);
42
     }
46
     }
43
 
47
 
44
     @Override
48
     @Override