KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > reflect > code > CtUnaryOperatorImpl


1 package spoon.support.reflect.code;
2
3 import spoon.reflect.code.CtExpression;
4 import spoon.reflect.code.CtStatement;
5 import spoon.reflect.code.CtStatementList;
6 import spoon.reflect.code.CtUnaryOperator;
7 import spoon.reflect.code.UnaryOperatorKind;
8 import spoon.reflect.declaration.CtElement;
9 import spoon.reflect.visitor.CtVisitor;
10
11 public class CtUnaryOperatorImpl<T> extends CtExpressionImpl<T> implements
12         CtUnaryOperator<T> {
13     private static final long serialVersionUID = 1L;
14     UnaryOperatorKind kind;
15
16     String JavaDoc label;
17
18     CtExpression<T> operand;
19
20     public void accept(CtVisitor visitor) {
21         visitor.visitCtUnaryOperator(this);
22     }
23
24     public CtExpression<T> getOperand() {
25         return operand;
26     }
27
28     public UnaryOperatorKind getKind() {
29         return kind;
30     }
31
32     public String JavaDoc getLabel() {
33         return label;
34     }
35
36     public void insertAfter(CtStatement statement) {
37         CtStatementImpl.insertAfter(this,statement);
38     }
39
40     public void insertBefore(CtStatement statement) {
41         CtStatementImpl.insertBefore(this,statement);
42     }
43
44     public void insertAfter(CtStatementList statements) {
45         CtStatementImpl.insertAfter(this,statements);
46     }
47
48     public void insertBefore(CtStatementList statements) {
49         CtStatementImpl.insertBefore(this,statements);
50     }
51
52     public void replace(CtElement element) {
53         if(element instanceof CtStatementList) {
54             CtStatementImpl.replace(this,(CtStatementList)element);
55         } else {
56             super.replace(element);
57         }
58     }
59     public void setOperand(CtExpression<T> expression) {
60         this.operand = expression;
61
62     }
63
64     public void setKind(UnaryOperatorKind kind) {
65         this.kind = kind;
66     }
67
68     public void setLabel(String JavaDoc label) {
69         this.label = label;
70     }
71
72 }
73
Popular Tags