Skip to content

Package: GenMutableMap

GenMutableMap

nameinstructionbranchcomplexitylinemethod
GenMutableMap(GenType, GenType)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
accept(GenCollectionTypeVisitor)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
create(GenType, GenType)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getFullyQualifiedTypeNameWithGenericArguments()
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getKey()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setKey(GenType)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import de.fhdw.wtf.generator.java.visitor.GenCollectionTypeVisitor;
4:
5: /**
6: * Represents a map type in the generator model.
7: */
8: public class GenMutableMap extends GenCollectionType {
9:         
10:         /**
11:          * Name of the Context class representing maps.
12:          */
13:         private static final String MUTABLE_MAP_TYPENAME = "MutableMap";
14:         
15:         /**
16:          * The map's key type.
17:          */
18:         private GenType key;
19:         
20:         /**
21:          * Creates a {@link GenMutableMap} object.
22:          *
23:          * @param key
24:          * The map's key type.
25:          * @param value
26:          * The map's value type.
27:          */
28:         protected GenMutableMap(final GenType key, final GenType value) {
29:                 super(MUTABLE_MAP_TYPENAME, value);
30:                 this.key = key;
31:         }
32:         
33:         /**
34:          * Creates a {@link GenMutableMap} object.
35:          *
36:          * @param key
37:          * The map's key type.
38:          * @param value
39:          * The map's value type.
40:          * @return A {@link GenMutableMap} object.
41:          */
42:         public static GenMutableMap create(final GenType key, final GenType value) {
43:                 return new GenMutableMap(key, value);
44:         }
45:         
46:         /**
47:          * Returns the map's key type.
48:          *
49:          * @return The map's key type.
50:          */
51:         public GenType getKey() {
52:                 return this.key;
53:         }
54:         
55:         /**
56:          * Sets the map's key type.
57:          *
58:          * @param key
59:          * The map's new key type.
60:          */
61:         public void setKey(final GenType key) {
62:                 this.key = key;
63:         }
64:         
65:         @Override
66:         public String getFullyQualifiedTypeNameWithGenericArguments() {
67:                 return this.getFullyQualifiedTypeName() + GEN_OPEN
68:                                 + this.getKey().getFullyQualifiedTypeNameWithGenericArguments() + COMMA
69:                                 + this.getType().getFullyQualifiedTypeNameWithGenericArguments() + GEN_CLOSE;
70:         }
71:         
72:         @Override
73:         public void accept(final GenCollectionTypeVisitor visitor) {
74:                 visitor.handle(this);
75:         }
76:         
77: }