Makefile fixup
[org.ibex.tool.git] / repo / org.ibex.tool / src / org / eclipse / jdt / internal / compiler / impl / StringConstant.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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 org.eclipse.jdt.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 public boolean compileTimeEqual(StringConstant right){
20         //String are intermed in the compiler==>thus if two string constant
21         //get to be compared, it is an equal on the vale which is done
22         if (this.value == null) {
23                 return right.value == null;
24         }
25         return this.value.equals(right.value);
26 }
27 public String stringValue() {
28         //spec 15.17.11
29
30         //the next line do not go into the toString() send....!
31         return value ;
32
33         /*
34         String s = value.toString() ;
35         if (s == null)
36                 return "null";
37         else
38                 return s;
39         */
40         
41 }
42 public String toString(){
43
44         return "(String)\"" + value +"\""; } //$NON-NLS-2$ //$NON-NLS-1$
45 public int typeID() {
46         return T_String;
47 }
48 }