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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.impl;
13 public class ByteConstant extends Constant {
15 public ByteConstant(byte value) {
18 public byte byteValue() {
21 public char charValue() {
24 public double doubleValue() {
25 return value; // implicit cast to return type
27 public float floatValue() {
28 return value; // implicit cast to return type
30 public int intValue() {
31 return value; // implicit cast to return type
33 public long longValue() {
34 return value; // implicit cast to return type
36 public short shortValue() {
37 return value; // implicit cast to return type
39 public String stringValue() {
42 String s = new Integer(value).toString() ;
43 if (s == null) return "null"; //$NON-NLS-1$
46 public String toString(){
48 return "(byte)" + value ; } //$NON-NLS-1$