removed Makefile; lifted repo/org.ibex.tool/src/ to src/
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / impl / BooleanConstant.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 import org.eclipse.jdt.internal.compiler.util.Util;
14
15 public class BooleanConstant extends Constant {
16
17         boolean value;
18         
19         public BooleanConstant(boolean value) {
20                 this.value = value;
21         }
22
23         public boolean booleanValue() {
24                 return value;
25         }
26
27         public String stringValue() {
28                 //spec 15.17.11
29                 String s = Util.toBoolean(value).toString();
30                 if (s == null) return "null"; //$NON-NLS-1$
31                 return s;
32         }
33
34         public String toString(){
35                 return "(boolean)" + value ;  //$NON-NLS-1$
36         }
37
38         public int typeID() {
39                 return T_boolean;
40         }
41 }