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