public class JCodeGen extends 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 SB |
toClass(SB sb,
String classSig,
String varname,
Frame f,
int nrows,
String comment)
Generates data sample as a dedicated class with static
double[][] member. |
static SB |
toClassWithArray(SB sb,
String modifiers,
String className,
float[] values) |
static SB |
toClassWithArray(SB sb,
String modifiers,
String className,
String[] values)
Generates a new class with one static member called VALUES which
is filled by values of given array.
|
static SB |
toClassWithArrayFill(SB sb,
String clzName,
float[] values,
int start,
int len) |
static SB |
toClassWithArrayFill(SB sb,
String clzName,
String[] values,
int start,
int len) |
static SB |
toField(SB sb,
String modifiers,
String type,
String fname,
String finit) |
static String |
toJavaId(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 SB |
toStaticVar(SB sb,
String varname,
double[] values) |
static SB |
toStaticVar(SB sb,
String varname,
double[] values,
String comment) |
static SB |
toStaticVar(SB sb,
String varname,
float[] values) |
static SB |
toStaticVar(SB sb,
String varname,
float[] values,
String comment) |
static SB |
toStaticVar(SB sb,
String varname,
Frame f,
int nrows,
String comment)
Outputs given frame as static variable with given name.
|
static SB |
toStaticVar(SB sb,
String varname,
int value) |
static SB |
toStaticVar(SB sb,
String varname,
int[] values) |
static SB |
toStaticVar(SB sb,
String varname,
int[] values,
String comment) |
static SB |
toStaticVar(SB sb,
String varname,
int value,
String comment) |
static SB |
toStaticVar(SB sb,
String varname,
String[] values) |
static SB |
toStaticVar(SB sb,
String varname,
String[] values,
String comment) |
public static int MAX_STRINGS_IN_CONST_POOL
public static SB toClass(SB sb, String classSig, String varname, Frame f, int nrows, String comment)
double[][] member.public static SB toStaticVar(SB sb, String varname, Frame f, int nrows, String comment)
public static SB toClassWithArray(SB sb, String modifiers, String className, String[] values)
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.public static SB toClassWithArray(SB sb, String modifiers, String className, float[] values)
sb - className - values - public static SB toClassWithArrayFill(SB sb, String clzName, String[] values, int start, int len)
public static SB toClassWithArrayFill(SB sb, String clzName, float[] values, int start, int len)
Copyright © 2013–2014 0xdata. All rights reserved.