Top Description Constructors Methods
com.sun.tools.javac.util

public Class Constants

extends Object
Class Inheritance
Imports
com.sun.tools.javac.code.Type

Utilities for operating on constant values.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object
decode(Object value, Type type)

Converts a constant in internal representation (in which boolean, char, byte, short, and int are each represented by an Integer) into standard representation.

public static String
format(Object value, Type type)

Returns a string representation of a constant value (given in internal representation), quoted and formatted as in Java source.

public static String
format(Object value)

Returns a string representation of a constant value (given in standard wrapped representation), quoted and formatted as in Java source.

private static String
formatByte(byte b)

private static String
formatChar(char c)

private static String
formatDouble(double d)

private static String
formatFloat(float f)

private static String
formatLong(long lng)

private static String
formatShort(short s)

private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Constantsback to summary
public Constants()

Method Detail

decodeback to summary
public static Object decode(Object value, Type type)

Converts a constant in internal representation (in which boolean, char, byte, short, and int are each represented by an Integer) into standard representation. Other values (including null) are returned unchanged.

formatback to summary
public static String format(Object value, Type type)

Returns a string representation of a constant value (given in internal representation), quoted and formatted as in Java source.

formatback to summary
public static String format(Object value)

Returns a string representation of a constant value (given in standard wrapped representation), quoted and formatted as in Java source.

formatByteback to summary
private static String formatByte(byte b)
formatCharback to summary
private static String formatChar(char c)
formatDoubleback to summary
private static String formatDouble(double d)
formatFloatback to summary
private static String formatFloat(float f)
formatLongback to summary
private static String formatLong(long lng)
formatShortback to summary
private static String formatShort(short s)
formatStringback to summary
private static String formatString(String s)