A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / lookup / VariableBinding.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.lookup;
12
13 import net.sourceforge.phpdt.internal.compiler.impl.Constant;
14
15 public abstract class VariableBinding extends Binding {
16         public int modifiers;
17
18         public TypeBinding type;
19
20         public char[] name;
21
22         public Constant constant;
23
24         public int id; // for flow-analysis (position in flowInfo bit vector)
25
26         public boolean isConstantValue() {
27                 return constant != Constant.NotAConstant;
28         }
29
30         public final boolean isBlankFinal() {
31                 return (modifiers & AccBlankFinal) != 0;
32         }
33
34         /*
35          * Answer true if the receiver is final and cannot be changed
36          */
37
38         public final boolean isFinal() {
39                 return (modifiers & AccFinal) != 0;
40         }
41
42         public char[] readableName() {
43                 return name;
44         }
45
46         public String toString() {
47                 String s = (type != null) ? type.debugName() : "UNDEFINED TYPE"; //$NON-NLS-1$
48                 s += " "; //$NON-NLS-1$
49                 s += (name != null) ? new String(name) : "UNNAMED FIELD"; //$NON-NLS-1$
50                 return s;
51         }
52 }