KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > javacore > jmiimpl > javamodel > StatementImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.javacore.jmiimpl.javamodel;
20
21 import org.netbeans.jmi.javamodel.*;
22 import org.netbeans.lib.java.parser.ASTree;
23 import org.netbeans.mdr.storagemodel.StorableObject;
24 import org.netbeans.lib.java.parser.ASTreeTypes;
25 import org.netbeans.lib.java.parser.ParserTokens;
26
27
28 /**
29  *
30  * @author Martin Matula
31  */

32 public abstract class StatementImpl extends TransientElement implements ParserTokens {
33     /** Creates a new instance of StatementImpl */
34     public StatementImpl(StorableObject o) {
35         super(o);
36     }
37
38     static Operator getOperator(int type) {
39         switch (type) {
40             case ASSIGN:
41                 return OperatorEnum.ASSIGN;
42             case PLUS_ASSIGN:
43                 return OperatorEnum.PLUSASSIGN;
44             case MINUS_ASSIGN:
45                 return OperatorEnum.MINUSASSIGN;
46             case MULTI_ASSIGN:
47                 return OperatorEnum.MULTIASSIGN;
48             case DIV_ASSIGN:
49                 return OperatorEnum.DIVASSIGN;
50             case AND_ASSIGN:
51                 return OperatorEnum.ANDASSIGN;
52             case OR_ASSIGN:
53                 return OperatorEnum.ORASSIGN;
54             case XOR_ASSIGN:
55                 return OperatorEnum.XORASSIGN;
56             case MOD_ASSIGN:
57                 return OperatorEnum.MODASSIGN;
58             case L_SHIFT_ASSIGN:
59                 return OperatorEnum.LSHIFTASSIGN;
60             case R_SHIFT_ASSIGN:
61                 return OperatorEnum.RSHIFTASSIGN;
62             case UR_SHIFT_ASSIGN:
63                 return OperatorEnum.URSHIFTASSIGN;
64             case MINUS:
65                 return OperatorEnum.MINUS;
66             case PLUS:
67                 return OperatorEnum.PLUS;
68             case MULTI:
69                 return OperatorEnum.MULTI;
70             case AND:
71                 return OperatorEnum.AND;
72             case DIV:
73                 return OperatorEnum.DIV;
74             case COMP:
75                 return OperatorEnum.COMP;
76             case DECREMENT:
77                 return OperatorEnum.DEC;
78             case EQ:
79                 return OperatorEnum.EQUAL;
80             case GT:
81                 return OperatorEnum.GT;
82             case GTE:
83                 return OperatorEnum.GTE;
84             case INCREMENT:
85                 return OperatorEnum.INC;
86             case BOOL_AND:
87                 return OperatorEnum.LAND;
88             case BOOL_OR:
89                 return OperatorEnum.LOR;
90             case L_SHIFT:
91                 return OperatorEnum.LSHIFT;
92             case LT:
93                 return OperatorEnum.LT;
94             case LTE:
95                 return OperatorEnum.LTE;
96             case MOD:
97                 return OperatorEnum.MOD;
98             case NEQ:
99                 return OperatorEnum.NEQUAL;
100             case NOT:
101                 return OperatorEnum.NOT;
102             case OR:
103                 return OperatorEnum.OR;
104             case R_SHIFT:
105                 return OperatorEnum.RSHIFT;
106             case UR_SHIFT:
107                 return OperatorEnum.URSHIFT;
108             case XOR:
109                 return OperatorEnum.XOR;
110             case INSTANCEOF:
111                 return OperatorEnum.INSTANCEOF;
112             default:
113                 return null;
114         }
115     }
116 }
117
Popular Tags