|
||||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.emf.codegen.ecore.genmodel.impl.Literals
Utility class for converting primitive values, strings, and classes to literals that could appear in code.
Method Summary | |
---|---|
static java.lang.String |
toBooleanLiteral(boolean b)
Returns the literal expression for the given boolean value. |
static java.lang.String |
toByteLiteral(byte b)
Returns the decimal literal expression for the given byte
value. |
static java.lang.String |
toCharLiteral(char c)
Returns a literal expression for the given char value. |
static java.lang.String |
toClassLiteral(java.lang.Class c)
Returns a literal expression for the given Class value. |
static java.lang.String |
toDoubleLiteral(double d)
Returns a literal expression for the given double value. |
static java.lang.String |
toFloatLiteral(float f)
Returns a literal expression for the given float value. |
static java.lang.String |
toIntLiteral(int i)
Returns the decimal literal expression for the given int
value. |
static java.lang.String |
toLiteral(java.lang.Object o)
Convenience dispatch method. |
static java.lang.String |
toLongLiteral(long l)
Returns the decimal literal expression for the given long
value. |
static java.lang.String |
toShortLiteral(short s)
Returns the decimal literal expression for the given short
value. |
static java.lang.String |
toStringLiteral(java.lang.String s)
Returns a literal expression for the given String . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String toLiteral(java.lang.Object o)
Boolean
, Byte
, Short
,
Integer
, Long
, Float
,
Double
, Character
, String
, or
Class
, the appropriate conversion method is called, with
the unwrapped primitive, or the String
or
Class
itself, as an argument.public static java.lang.String toBooleanLiteral(boolean b)
boolean
value.public static java.lang.String toByteLiteral(byte b)
byte
value.public static java.lang.String toShortLiteral(short s)
short
value.public static java.lang.String toIntLiteral(int i)
int
value.public static java.lang.String toLongLiteral(long l)
long
value.public static java.lang.String toFloatLiteral(float f)
float
value.
This literal may be in simple form or exponential notation, or it may
be one of the special values java.lang.Float.NaN
,
java.lang.Float.POSITIVE_INFINITY
, or
java.lang.Float.NEGATIVE_INFINITY
.public static java.lang.String toDoubleLiteral(double d)
double
value.
This literal may be in simple form or exponential notation, or it may
be one of the special values java.lang.Double.NaN
,
java.lang.Double.POSITIVE_INFINITY
, or
java.lang.Double.NEGATIVE_INFINITY
.public static java.lang.String toCharLiteral(char c)
char
value.
This literal will be in its escaped form if it is backspace,
horizontal tab, newline, form feed, carriage return, double quote,
single quote, or backslash. If it is within the common printable
range of space (32) to ~
(126), it will simply be the
character literal. Otherwise, it will be in the escaped Unicode
encoding form.public static java.lang.String toStringLiteral(java.lang.String s)
String
. Each
of its characters will appear in the same form as if it was the
argument to toCharLiteral(char)
.public static java.lang.String toClassLiteral(java.lang.Class c)
Class
value.
|
Copyright 2001-2003 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS SOURCE NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |