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 classSourceCodeProperties.Prefix
-
Field Summary
Fields Modifier and Type Field Description static SourceCodePropertiesJAVA_FORM_PROPERTIESstatic SourceCodePropertiesJAVA_FORM_PROPERTIES_NO_SYMBOL_PREFIXbooleannoSymbolPrefixIftrue, for symbols likex,y,z,...don't use theF....SourceCodeProperties.PrefixprefixIfSourceCodeProperties.Prefix.CLASS_NAMEuse theF....class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAMEuse the fully qualified class name, ifSourceCodeProperties.Prefix.NONEuse no prefix.static SourceCodePropertiesSCALA_FORM_NO_SYMBOL_FACTORYstatic SourceCodePropertiesSCALA_FORM_SYMBOL_FACTORYstatic SourceCodePropertiesSTRING_FORM_NO_SYMBOL_FACTORYstatic SourceCodePropertiesSTRING_FORM_SYMBOL_FACTORYbooleansymbolsAsFactoryMethodIftrueuse theF.symbol()method, otherwise print the symbol name.booleanuseOperatorsIf 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 SourceCodePropertiescopyWithoutSymbolsAsFactoryMethod(SourceCodeProperties o)Returns aSourceCodePropertiesobjects with the same values as the given one except that the fieldsymbolsAsFactoryMethodof the returned object is alwaysfalse.static StringgetPrefixF(SourceCodeProperties properties)static SourceCodePropertiesof(boolean symbolsAsFactoryMethod, boolean useOperators, SourceCodeProperties.Prefix prefix, boolean noSymbolPrefix)Reaturns aSourceCodePropertiesobject with the specified parameters.static SourceCodePropertiesscalaFormProperties(boolean symbolsAsFactoryMethod)static SourceCodePropertiesstringFormProperties(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
Iftrueuse 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_NAMEuse theF....class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAMEuse the fully qualified class name, ifSourceCodeProperties.Prefix.NONEuse 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 aSourceCodePropertiesobjects with the same values as the given one except that the fieldsymbolsAsFactoryMethodof 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 aSourceCodePropertiesobject with the specified parameters.- Parameters:
symbolsAsFactoryMethod- iftrueuse 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_NAMEuse theF....class prefix for generating Java code, ifSourceCodeProperties.Prefix.FULLY_QUALIFIED_CLASS_NAMEuse the fully qualified class name, ifSourceCodeProperties.Prefix.NONEuse 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)
-
-