Merged xdebug from 1.3.x
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / impl / BooleanConstant.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 BooleanConstant extends Constant {
14         boolean value;
15
16         public BooleanConstant(boolean value) {
17                 this.value = value;
18         }
19
20         public boolean booleanValue() {
21                 return (boolean) value;
22         }
23
24         public String stringValue() {
25                 // spec 15.17.11
26
27                 String s = new Boolean(value).toString();
28                 if (s == null)
29                         return "null"; //$NON-NLS-1$
30                 else
31                         return s;
32         }
33
34         public String toString() {
35
36                 return "(boolean)" + value;} //$NON-NLS-1$
37
38         public int typeID() {
39                 return T_boolean;
40         }
41 }