Skip to content

Package: AbstractReturnValue

AbstractReturnValue

nameinstructionbranchcomplexitylinemethod
AbstractReturnValue()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
existsIterationVars()
M: 0 C: 7
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getIterationVars()
M: 0 C: 11
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getModelType()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getStringRepresentation()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isArrayValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isBooleanValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isNumericValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isStringValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isVersionValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isVoidValue()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toArrayValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toBooleanValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toNumericValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toStringValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toVersionValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toVoidValue()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package pruefskript.parser.values;
2:
3: import java.util.HashMap;
4: import java.util.Map;
5:
6: import basic.PruefskriptConstants;
7: import pruefskript.parser.exceptions.WrongNodeException;
8: import pruefskript.parser.nodes.IteratorHelper;
9: import symbols.WrongTypeError;
10:
11: /**
12: * abstract class for the returntypes of the interprete-function.
13: *
14: * @author Lisa
15: *
16: */
17: public class AbstractReturnValue {
18:         /**
19:          * AbstractReturnValue.
20:          */
21:         private Map<String, IteratorHelper> iterationVars;
22:
23:         /**
24:          * AbstractReturnValue.
25:          */
26:         public AbstractReturnValue() {
27:                 super();
28:                 this.iterationVars = null;
29:         }
30:
31:         /**
32:          *
33:          * @return true, if the ReturnValue is a string value.
34:          */
35:         public Boolean isStringValue() {
36:                 return Boolean.FALSE;
37:         }
38:
39:         /**
40:          *
41:          * @return true, if the ReturnValue is a numeric value.
42:          */
43:         public Boolean isNumericValue() {
44:                 return Boolean.FALSE;
45:         }
46:
47:         /**
48:          *
49:          * @return true, if the ReturnValue is a boolean value.
50:          */
51:         public Boolean isBooleanValue() {
52:                 return Boolean.FALSE;
53:         }
54:
55:         /**
56:          *
57:          * @return true, if the ReturnValue is a version value.
58:          */
59:         public Boolean isVersionValue() {
60:                 return Boolean.FALSE;
61:         }
62:
63:         /**
64:          *
65:          * @return true, if the ReturnValue is a void value.
66:          */
67:         public Boolean isVoidValue() {
68:                 return Boolean.FALSE;
69:         }
70:
71:         /**
72:          *
73:          * @return true, if the ReturnValue is a array value.
74:          */
75:         public Boolean isArrayValue() {
76:                 return Boolean.FALSE;
77:         }
78:
79:         /**
80:          * @return an error, if the returnvalue is not a string value
81:          */
82:         public StringValue toStringValue() {
83:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_STRING);
84:         }
85:
86:         /**
87:          * @return an error, if the returnvalue is not a numeric value
88:          */
89:         public NumericValue toNumericValue() {
90:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_NUMERIC);
91:         }
92:
93:         /**
94:          * @return an error, if the returnvalue is not a boolean value
95:          */
96:         public BooleanValue toBooleanValue() {
97:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_BOOLEAN);
98:         }
99:
100:         /**
101:          * @return an error, if the returnvalue is not a version value
102:          */
103:         public VersionValue toVersionValue() {
104:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_VERSION);
105:         }
106:
107:         /**
108:          * @return an error, if the returnvalue is not a void value
109:          */
110:         public VoidValue toVoidValue() {
111:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_VOID);
112:         }
113:
114:         /**
115:          * @return an error, if the returnvalue is not a array value
116:          */
117:         public ArrayValue toArrayValue() {
118:                 throw new WrongTypeError(PruefskriptConstants.UNEXPECTED_ARRAY);
119:         }
120:
121:         /**
122:          * @return the laufVariablen
123:          */
124:         public Map<String, IteratorHelper> getIterationVars() {
125:•                if (this.iterationVars == null) {
126:                         this.iterationVars = new HashMap<String, IteratorHelper>();
127:                 }
128:                 return this.iterationVars;
129:         }
130:
131:         /**
132:          *
133:          * @return laufVariablen
134:          */
135:         public boolean existsIterationVars() {
136:•                return this.iterationVars != null;
137:         }
138:
139:         /**
140:          *
141:          * @return the string representation of the value.
142:          */
143:         public String getStringRepresentation() { // TODO: impl throw new exception
144:                 return "ABSTRACTVALUE";
145:         }
146:
147:         /**
148:          *
149:          * @return the type representation of the value.
150:          * @throws WrongNodeException
151:          * .
152:          */
153:         public String getModelType() throws WrongNodeException { // TODO: impl throw new exception
154:                 throw new WrongNodeException("TYPEPROBLEM");
155:         }
156: }