Skip to content

Method: accept(AttributModifierVisitor)

1: package de.fhdw.wtf.common.ast;
2:
3: import de.fhdw.wtf.common.ast.visitor.AttributModifierVisitor;
4: import de.fhdw.wtf.common.ast.visitor.AttributeModifierVisitorReturn;
5: import de.fhdw.wtf.common.ast.visitor.AttributeModifierVisitorReturnException;
6: import de.fhdw.wtf.common.token.Token;
7:
8: /**
9: *
10: * Represents a "mutable"-Attributemodifier. The containing attribute is changeable after codegeneration.
11: */
12: public final class AttributeModifierMutable extends AttributeModifier {
13:         
14:         /**
15:          * generated.
16:          */
17:         private static final long serialVersionUID = 8739729865194347077L;
18:         
19:         /**
20:          * Constant to define hashCode().
21:          */
22:         private static final int HASHCODE_CONSTANT = 4747;
23:         
24:         /**
25:          * Private Constructor of {@link AttributeModifierMutable}.
26:          *
27:          * @param firstToken
28:          * firstToken
29:          * @param lastToken
30:          * lastToken
31:          */
32:         private AttributeModifierMutable(final Token firstToken, final Token lastToken) {
33:                 super(firstToken, lastToken);
34:         }
35:         
36:         /**
37:          * Creates a {@link AttributeModifierMutable}-Object.
38:          *
39:          * @param firstToken
40:          * firstToken
41:          * @param lastToken
42:          * lastToken
43:          * @return The AttributeModifierMutable-Object.
44:          */
45:         public static AttributeModifierMutable create(final Token firstToken, final Token lastToken) {
46:                 return new AttributeModifierMutable(firstToken, lastToken);
47:         }
48:         
49:         /**
50:          * Creates a {@link AttributeModifierMutable}-Object.
51:          *
52:          * @param firstToken
53:          * firstToken
54:          * @return The AttributeModifierMutable-Object.
55:          */
56:         public static AttributeModifierMutable create(final Token firstToken) {
57:                 return new AttributeModifierMutable(firstToken, null);
58:         }
59:         
60:         @Override
61:         public boolean equals(final Object o) {
62:                 return o instanceof AttributeModifierMutable;
63:         }
64:         
65:         @Override
66:         public int hashCode() {
67:                 return HASHCODE_CONSTANT;
68:         }
69:         
70:         @Override
71:         public String toString() {
72:                 return de.fhdw.wtf.common.constants.parser.AstDescriptionConstants.MODIFIER_MUTABLE;
73:         }
74:         
75:         @Override
76:         public boolean accept(final AttributModifierVisitor visitor) {
77:                 return visitor.handle(this);
78:         }
79:         
80:         @Override
81:         public <X> X accept(final AttributeModifierVisitorReturn<X> visitor) {
82:                 return visitor.handle(this);
83:         }
84:         
85:         @Override
86:         public <X, Y extends Exception> X accept(final AttributeModifierVisitorReturnException<X, Y> visitor) throws Y {
87:                 return visitor.handle(this);
88:         }
89: }