Makefile fixup
[org.ibex.tool.git] / repo / org.ibex.tool / src / org / eclipse / jdt / internal / compiler / impl / CharConstant.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 CharConstant extends Constant {
14
15         char value;
16
17         public CharConstant(char value) {
18                 this.value = value;
19         }
20         public byte byteValue() {
21                 return (byte) value;
22         }
23         public char charValue() {
24                 return this.value;
25         }
26         public double doubleValue() {
27                 return value; // implicit cast to return type
28         }
29         public float floatValue() {
30                 return value; // implicit cast to return type
31         }
32         public int intValue() {
33                 return value; // implicit cast to return type
34         }
35         public long longValue() {
36                 return value; // implicit cast to return type
37         }
38         public short shortValue() {
39                 return (short) value;
40         }
41         public String stringValue() {
42                 //spec 15.17.11
43                 
44                 String s = new Character(value).toString() ;
45                 if (s == null) return "null"; //$NON-NLS-1$
46                 return s;
47         }
48         public String toString(){
49         
50                 return "(char)" + value; //$NON-NLS-1$
51         }
52         public int typeID() {
53                 return T_char;
54         }
55 }