Package org.matheclipse.core.eval.util
Class SourceCodeProperties
- java.lang.Object
-
- org.matheclipse.core.eval.util.SourceCodeProperties
-
public class SourceCodeProperties extends Object
Define properties how to generate Java, Scala or other source codes from Symja expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SourceCodeProperties.Prefix
-
Field Summary
Fields Modifier and Type Field Description static SourceCodeProperties
JAVA_FORM_PROPERTIES
static SourceCodeProperties
JAVA_FORM_PROPERTIES_NO_SYMBOL_PREFIX
boolean
noSymbolPrefix
Iftrue
, for symbols likex,y,z,...
don't use theF....
SourceCodeProperties.Prefix
prefix
IfSourceCodeProperties.Prefix.CLASS_NAME
use theF....
class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAME
use the fully qualified class name, ifSourceCodeProperties.Prefix.NONE
use no prefix.static SourceCodeProperties
SCALA_FORM_NO_SYMBOL_FACTORY
static SourceCodeProperties
SCALA_FORM_SYMBOL_FACTORY
static SourceCodeProperties
STRING_FORM_NO_SYMBOL_FACTORY
static SourceCodeProperties
STRING_FORM_SYMBOL_FACTORY
boolean
symbolsAsFactoryMethod
Iftrue
use theF.symbol()
method, otherwise print the symbol name.boolean
useOperators
If true use operators instead of function names for representation of Plus, Times, Power,...
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SourceCodeProperties
copyWithoutSymbolsAsFactoryMethod(SourceCodeProperties o)
Returns aSourceCodeProperties
objects with the same values as the given one except that the fieldsymbolsAsFactoryMethod
of the returned object is alwaysfalse
.static String
getPrefixF(SourceCodeProperties properties)
static SourceCodeProperties
of(boolean symbolsAsFactoryMethod, boolean useOperators, SourceCodeProperties.Prefix prefix, boolean noSymbolPrefix)
Reaturns aSourceCodeProperties
object with the specified parameters.static SourceCodeProperties
scalaFormProperties(boolean symbolsAsFactoryMethod)
static SourceCodeProperties
stringFormProperties(boolean symbolsAsFactoryMethod)
-
-
-
Field Detail
-
JAVA_FORM_PROPERTIES
public static final SourceCodeProperties JAVA_FORM_PROPERTIES
-
JAVA_FORM_PROPERTIES_NO_SYMBOL_PREFIX
public static final SourceCodeProperties JAVA_FORM_PROPERTIES_NO_SYMBOL_PREFIX
-
STRING_FORM_SYMBOL_FACTORY
public static final SourceCodeProperties STRING_FORM_SYMBOL_FACTORY
-
STRING_FORM_NO_SYMBOL_FACTORY
public static final SourceCodeProperties STRING_FORM_NO_SYMBOL_FACTORY
-
SCALA_FORM_NO_SYMBOL_FACTORY
public static final SourceCodeProperties SCALA_FORM_NO_SYMBOL_FACTORY
-
SCALA_FORM_SYMBOL_FACTORY
public static final SourceCodeProperties SCALA_FORM_SYMBOL_FACTORY
-
symbolsAsFactoryMethod
public final boolean symbolsAsFactoryMethod
Iftrue
use theF.symbol()
method, otherwise print the symbol name.
-
useOperators
public final boolean useOperators
If true use operators instead of function names for representation of Plus, Times, Power,...
-
prefix
public final SourceCodeProperties.Prefix prefix
IfSourceCodeProperties.Prefix.CLASS_NAME
use theF....
class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAME
use the fully qualified class name, ifSourceCodeProperties.Prefix.NONE
use no prefix.
-
noSymbolPrefix
public final boolean noSymbolPrefix
Iftrue
, for symbols likex,y,z,...
don't use theF....
class prefix for code generation.
-
-
Method Detail
-
copyWithoutSymbolsAsFactoryMethod
public static SourceCodeProperties copyWithoutSymbolsAsFactoryMethod(SourceCodeProperties o)
Returns aSourceCodeProperties
objects with the same values as the given one except that the fieldsymbolsAsFactoryMethod
of the returned object is alwaysfalse
.
-
getPrefixF
public static String getPrefixF(SourceCodeProperties properties)
-
of
public static SourceCodeProperties of(boolean symbolsAsFactoryMethod, boolean useOperators, SourceCodeProperties.Prefix prefix, boolean noSymbolPrefix)
Reaturns aSourceCodeProperties
object with the specified parameters.- Parameters:
symbolsAsFactoryMethod
- iftrue
use theF.symbol()
method, otherwise print the symbol name.useOperators
- use operators instead of function names for representation of Plus, Times, Power,...prefix
- ifSourceCodeProperties.Prefix.CLASS_NAME
use theF....
class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAME
use the fully qualified class name, ifSourceCodeProperties.Prefix.NONE
use no prefix.noSymbolPrefix
- for symbols likex,y,z,...
don't use theF....
class prefix for code generation
-
scalaFormProperties
public static SourceCodeProperties scalaFormProperties(boolean symbolsAsFactoryMethod)
-
stringFormProperties
public static SourceCodeProperties stringFormProperties(boolean symbolsAsFactoryMethod)
-
-