public class JCodeGen
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_STRINGS_IN_CONST_POOL
Maximum number of string generated per class (static initializer)
|
Constructor and Description |
---|
JCodeGen() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canCompile() |
static java.lang.Class |
compile(java.lang.String class_name,
java.lang.String java_text) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
double[] values) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
double[][] values) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
double[][][] values,
java.lang.String comment) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
double[][] values,
java.lang.String comment) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
double[] values,
java.lang.String comment) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
float[] values) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
float[] values,
java.lang.String comment) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
int[] values) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
int[] values,
java.lang.String comment) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
java.lang.String[] values) |
static JCodeSB |
toClassWithArray(JCodeSB sb,
java.lang.String modifiers,
java.lang.String className,
java.lang.String[] values,
java.lang.String comment)
Generates a new class with one static member called VALUES which
is filled by values of given array.
|
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
double[][][] values,
int start,
int len) |
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
double[][] values,
int start,
int len) |
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
double[] values,
int start,
int len) |
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
float[] values,
int start,
int len) |
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
int[] values,
int start,
int len) |
static JCodeSB |
toClassWithArrayFill(JCodeSB sb,
java.lang.String clzName,
java.lang.String[] values,
int start,
int len) |
static java.lang.String |
toJavaId(java.lang.String s)
Transform given string to legal java Identifier (see Java grammar http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8)
|
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
boolean[] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
double[][][] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
double[][] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
double[] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
float[] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
int[] values,
java.lang.String comment) |
static JCodeSB |
toStaticVar(JCodeSB sb,
java.lang.String varname,
java.lang.String[] values,
java.lang.String comment) |
static <T extends JCodeSB> |
toStaticVar(T sb,
java.lang.String varname,
int value,
java.lang.String comment) |
static JCodeSB |
toStaticVarZeros(JCodeSB sb,
java.lang.String varname,
double[] values,
java.lang.String comment) |
public static int MAX_STRINGS_IN_CONST_POOL
public static <T extends JCodeSB> T toStaticVar(T sb, java.lang.String varname, int value, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, java.lang.String[] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, float[] values, java.lang.String comment)
public static JCodeSB toStaticVarZeros(JCodeSB sb, java.lang.String varname, double[] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, double[] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, int[] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, double[][] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, double[][][] values, java.lang.String comment)
public static JCodeSB toStaticVar(JCodeSB sb, java.lang.String varname, boolean[] values, java.lang.String comment)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, java.lang.String[] values, java.lang.String comment)
The generator can generate more classes to avoid limit of class constant pool holding all generated literals
.sb
- outputclassName
- name of generated classvalues
- array holding values which should be hold in generated field VALUES.comment
- comment to prefix the class withpublic static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, java.lang.String[] values)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, double[] values, java.lang.String comment)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, double[] values)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, float[] values, java.lang.String comment)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, float[] values)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, int[] values, java.lang.String comment)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, int[] values)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, double[][] values, java.lang.String comment)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, double[][] values)
public static JCodeSB toClassWithArray(JCodeSB sb, java.lang.String modifiers, java.lang.String className, double[][][] values, java.lang.String comment)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, java.lang.String[] values, int start, int len)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, float[] values, int start, int len)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, double[] values, int start, int len)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, int[] values, int start, int len)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, double[][] values, int start, int len)
public static JCodeSB toClassWithArrayFill(JCodeSB sb, java.lang.String clzName, double[][][] values, int start, int len)
public static java.lang.String toJavaId(java.lang.String s)
public static boolean canCompile()
public static java.lang.Class compile(java.lang.String class_name, java.lang.String java_text) throws java.lang.Exception
java.lang.Exception