Skip to content

Package: AddToOptFacade

AddToOptFacade

nameinstructionbranchcomplexitylinemethod
AddToOptFacade(CommunicationManager, AddToOptNode)
M: 0 C: 43
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 8
100%
M: 0 C: 1
100%
AddToOptFacade(String, String)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getFlags()
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%
getPath()
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%

Coverage

1: package pruefskript.parser.nodes;
2:
3: import basic.PruefskriptConstants;
4: import pruefskript.CommunicationManager;
5: import pruefskript.parser.exceptions.CheckScriptException;
6: import pruefskript.parser.exceptions.WrongNodeException;
7: import pruefskript.parser.values.AbstractReturnValue;
8:
9: /**
10: * AddToOpt.
11: *
12: * @author Phil
13: *
14: */
15: public class AddToOptFacade {
16:         /**
17:          *
18:          */
19:         private final String path;
20:         /**
21:         *
22:         */
23:         private final String flags;
24:
25:         /**
26:          *
27:          * @param mgr
28:          * The {@link CommunicationManager} to use.
29:          * @param node
30:          * The node
31:          * @throws CheckScriptException
32:          * PruefscriptException
33:          */
34:         public AddToOptFacade(final CommunicationManager mgr, final AddToOptNode node)
35:                         throws CheckScriptException {
36:                 final AbstractReturnValue op1 = node.getOperand1().interpret(mgr);
37:                 final AbstractReturnValue op2 = node.getOperand2().interpret(mgr);
38:•                if (op1.isStringValue() && op2.isStringValue()) {
39:                         this.path = node.getOperand1().interpret(mgr).toStringValue().getValue();
40:                         this.flags = node.getOperand2().interpret(mgr).toStringValue().getValue();
41:                 } else {
42:                         throw new WrongNodeException(PruefskriptConstants.UNEXPECTED_STRING);
43:                 }
44:         }
45:
46:         /**
47:          * @param flags
48:          * die flags
49:          * @param path
50:          * der pfad The node
51:          * @throws CheckScriptException
52:          * PruefscriptException
53:          */
54:         public AddToOptFacade(final String path, final String flags) throws CheckScriptException {
55:
56:                 this.path = path;
57:                 this.flags = flags;
58:
59:         }
60:
61:         /**
62:          * @return the flags
63:          */
64:         public String getFlags() {
65:                 return this.flags;
66:         }
67:
68:         /**
69:          * @return the name
70:          */
71:         public String getPath() {
72:                 return this.path;
73:         }
74:
75: }