Package org.qdl_lang.util
Class InputFormUtil
- java.lang.Object
-
- org.qdl_lang.util.InputFormUtil
-
public class InputFormUtil extends Object
Utility that converts various objects to their input form. Input form is defined as the statement to create the object. This might not reflect the current state of the object for modules since that is highly mutable.Created by Jeff Gaynor
on 3/10/21 at 8:38 AM
-
-
Field Summary
Fields Modifier and Type Field Description static BigDecimalbottomprotected static DecimalFormatDformatterprotected static DecimalFormatEformatterstatic StringJAVA_CLASS_MARKERstatic BigDecimaltop
-
Constructor Summary
Constructors Constructor Description InputFormUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static StringformatBD(BigDecimal d)protected static StringformatBD2(BigDecimal d)static StringinputForm(Boolean b)static StringinputForm(Long myLong)static StringinputForm(Object obj)static StringinputForm(String s)static StringinputForm(String fName, int argCount, State state)Look up a function for the given state by arg count.static StringinputForm(BigDecimal d)static StringinputForm(Module m)static StringinputForm(FunctionRecord fr)static StringinputForm(QDLNull qdlNull)static StringinputForm(QDLSet set)static StringinputForm(QDLStem stemVariable)static StringinputForm(QDLStem stemVariable, int indentFactor)static StringinputForm(QDLValue qdlValue)static StringinputFormModule(String moduleName, State state)static StringinputFormModule(URI moduleNS, State state)Finds the input form for a module.static StringinputFormVar(String varName, int indentFactor, State state)Finds the input form for a variable from the state.static StringinputFormVar(String varName, State state)protected static booleanisDBInRange(BigDecimal d)static voidmain(String[] args)
-
-
-
Field Detail
-
JAVA_CLASS_MARKER
public static String JAVA_CLASS_MARKER
-
top
public static BigDecimal top
-
bottom
public static BigDecimal bottom
-
Dformatter
protected static DecimalFormat Dformatter
-
Eformatter
protected static DecimalFormat Eformatter
-
-
Method Detail
-
inputForm
public static String inputForm(BigDecimal d)
-
formatBD
protected static String formatBD(BigDecimal d)
-
isDBInRange
protected static boolean isDBInRange(BigDecimal d)
-
formatBD2
protected static String formatBD2(BigDecimal d)
-
inputForm
public static String inputForm(String fName, int argCount, State state)
Look up a function for the given state by arg count. If there is no such function, then an null string is returned.- Parameters:
fName-argCount-state-- Returns:
-
inputForm
public static String inputForm(FunctionRecord fr)
-
inputFormModule
public static String inputFormModule(URI moduleNS, State state)
Finds the input form for a module. Note that the name is either an alias, like acl or acl# (trailing # is optional) or the namespace (like oa4mp:/util/acl)- Parameters:
moduleNS-state-- Returns:
-
inputFormVar
public static String inputFormVar(String varName, int indentFactor, State state)
Finds the input form for a variable from the state.- Parameters:
varName-state-- Returns:
-
main
public static void main(String[] args)
-
-