Skip to content

Package: GenSimpleOperationState

GenSimpleOperationState

nameinstructionbranchcomplexitylinemethod
GenSimpleOperationState(String)
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%
accept(GenOperationStateVisitor)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
accept(GenOperationStateVisitorException)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
accept(GenOperationStateVisitorReturn)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
accept(GenOperationStateVisitorReturnException)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
create(String)
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%
getFullOperationWithPossibleImplementation()
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%
getOverwrittenOperation()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setFullOperationWithPossibleImplementation(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setOverwrittenOperation(GenJavaOperation)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import de.fhdw.wtf.generator.java.visitor.GenOperationStateVisitor;
4: import de.fhdw.wtf.generator.java.visitor.GenOperationStateVisitorException;
5: import de.fhdw.wtf.generator.java.visitor.GenOperationStateVisitorReturn;
6: import de.fhdw.wtf.generator.java.visitor.GenOperationStateVisitorReturnException;
7:
8: /**
9: * This state indicates an imported operation with full method.
10: *
11: */
12: public final class GenSimpleOperationState implements GenOperationState {
13:         
14:         /**
15:          * Implementation of the method with full operation header.
16:          */
17:         private String fullOperationWithPossibleImplementation;
18:         
19:         /**
20:          * Possible original model operation that is overwritten by this simple operation.
21:          */
22:         private GenJavaOperation overwrittenOperation;
23:         
24:         /**
25:          * Instantiates a new {@link GenSimpleOperationState}.
26:          *
27:          * @param fullOperationWithPossibleImplementation
28:          * Implementation of the method with full operation header.
29:          */
30:         private GenSimpleOperationState(final String fullOperationWithPossibleImplementation) {
31:                 this.fullOperationWithPossibleImplementation = fullOperationWithPossibleImplementation;
32:         }
33:         
34:         /**
35:          * Creates a new {@link GenSimpleOperationState}.
36:          *
37:          * @param fullOperationWithPossibleImplementation
38:          * Implementation of the method with full operation header.
39:          * @return {@link GenSimpleOperationState}
40:          */
41:         public static GenSimpleOperationState create(final String fullOperationWithPossibleImplementation) {
42:                 return new GenSimpleOperationState(fullOperationWithPossibleImplementation);
43:         }
44:         
45:         @Override
46:         public void accept(final GenOperationStateVisitor visitor) {
47:                 visitor.handle(this);
48:         }
49:         
50:         @Override
51:         public <X> X accept(final GenOperationStateVisitorReturn<X> visitor) {
52:                 return visitor.handle(this);
53:         }
54:         
55:         @Override
56:         public <Y extends Exception> void accept(final GenOperationStateVisitorException<Y> visitor) throws Y {
57:                 visitor.handle(this);
58:         }
59:         
60:         @Override
61:         public <X, Y extends Exception> X accept(final GenOperationStateVisitorReturnException<X, Y> visitor) throws Y {
62:                 return visitor.handle(this);
63:         }
64:         
65:         /**
66:          * Returns the implementation of the method with full operation header.
67:          *
68:          * @return String
69:          */
70:         public String getFullOperationWithPossibleImplementation() {
71:                 return this.fullOperationWithPossibleImplementation;
72:         }
73:         
74:         /**
75:          * Sets the implementation of the method with full operation header.
76:          *
77:          * @param fullOperationWithPossibleImplementation
78:          * The new implementation of the method with full operation header.
79:          */
80:         public void setFullOperationWithPossibleImplementation(final String fullOperationWithPossibleImplementation) {
81:                 this.fullOperationWithPossibleImplementation = fullOperationWithPossibleImplementation;
82:         }
83:         
84:         /**
85:          * Returns the possible original model operation that is overwritten by this simple operation.
86:          *
87:          * @return {@link GenJavaOperation}
88:          */
89:         public GenJavaOperation getOverwrittenOperation() {
90:                 return this.overwrittenOperation;
91:         }
92:         
93:         /**
94:          * Sets the possible original model operation that is overwritten by this simple operation.
95:          *
96:          * @param overwrittenOperation
97:          * The new operation that is the original model operation that is overwritten by this simple operation.
98:          */
99:         public void setOverwrittenOperation(final GenJavaOperation overwrittenOperation) {
100:                 this.overwrittenOperation = overwrittenOperation;
101:         }
102: }