Skip to content

Method: getParameters()

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: import java.util.ArrayList;
4: import java.util.List;
5:
6: import de.fhdw.wtf.generator.java.visitor.GenOperationVisitorReturn;
7:
8: /**
9: * This class describes operations and constructors with their arguments.
10: */
11: public abstract class GenOperation extends GenClassMember {
12:         
13:         private GenOperationState state;
14:         private final List<GenParameter> parameters;
15:         private final ArrayList<Generic> generics;
16:         
17:         protected GenOperation(final String name, final List<GenParameter> parameters, final GenOperationState state) {
18:                 super(name);
19:                 this.parameters = parameters;
20:                 this.generics = new ArrayList<>();
21:                 this.state = state;
22:         }
23:         
24:         /**
25:          * Calls the handle method in the given visitor.
26:          *
27:          * @param visitor
28:          * The visitor to handle this type.
29:          * @param <X>
30:          * The returntype of the handle and the accept method.
31:          * @return Returns the result of type <X> that is returned by the handle method.
32:          */
33:         public abstract <X> X accept(GenOperationVisitorReturn<X> visitor);
34:         
35:         public void setState(final GenOperationState state) {
36:                 this.state = state;
37:         }
38:         
39:         public GenOperationState getState() {
40:                 return this.state;
41:         }
42:         
43:         public List<GenParameter> getParameters() {
44:                 return this.parameters;
45:         }
46:         
47:         public ArrayList<Generic> getGenerics() {
48:                 return this.generics;
49:         }
50:         
51: }