1) Changed indentation of (single or double) quoted strings to align on the first...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / impl / StringConstant.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.impl;
12
13 public class StringConstant extends Constant {
14         public String value;
15
16         public StringConstant(String value) {
17                 this.value = value;
18         }
19
20         public boolean compileTimeEqual(StringConstant right) {
21                 // String are intermed in the compiler==>thus if two string constant
22                 // get to be compared, it is an equal on the vale which is done
23                 if (this.value == null) {
24                         return right.value == null;
25                 }
26                 return this.value.equals(right.value);
27         }
28
29         public String stringValue() {
30                 // spec 15.17.11
31
32                 // the next line do not go into the toString() send....!
33                 return value;
34
35                 /*
36                  * String s = value.toString() ; if (s == null) return "null"; else
37                  * return s;
38                  */
39
40         }
41
42         public String toString() {
43
44                 return "(String)\"" + value + "\"";} //$NON-NLS-2$ //$NON-NLS-1$
45
46         public int typeID() {
47                 return T_String;
48         }
49 }