com.sun.tools.javac.util
Class Constants

java.lang.Object
  extended by com.sun.tools.javac.util.Constants

public class Constants
extends java.lang.Object

Utilities for operating on constant values.

This is NOT part of any API supported by Sun Microsystems. 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
Constants()
           
 
Method Summary
static java.lang.Object decode(java.lang.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.
static java.lang.String format(java.lang.Object value)
          Returns a string representation of a constant value (given in standard wrapped representation), quoted and formatted as in Java source.
static java.lang.String format(java.lang.Object value, Type type)
          Returns a string representation of a constant value (given in internal representation), quoted and formatted as in Java source.
private static java.lang.String formatByte(byte b)
           
private static java.lang.String formatChar(char c)
           
private static java.lang.String formatDouble(double d)
           
private static java.lang.String formatFloat(float f)
           
private static java.lang.String formatLong(long lng)
           
private static java.lang.String formatString(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constants

public Constants()
Method Detail

decode

public static java.lang.Object decode(java.lang.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.


format

public static java.lang.String format(java.lang.Object value,
                                      Type type)
Returns a string representation of a constant value (given in internal representation), quoted and formatted as in Java source.


format

public static java.lang.String format(java.lang.Object value)
Returns a string representation of a constant value (given in standard wrapped representation), quoted and formatted as in Java source.


formatByte

private static java.lang.String formatByte(byte b)

formatLong

private static java.lang.String formatLong(long lng)

formatFloat

private static java.lang.String formatFloat(float f)

formatDouble

private static java.lang.String formatDouble(double d)

formatChar

private static java.lang.String formatChar(char c)

formatString

private static java.lang.String formatString(java.lang.String s)