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 BigDecimal
bottom
protected static DecimalFormat
Dformatter
protected static DecimalFormat
Eformatter
static String
JAVA_CLASS_MARKER
static BigDecimal
top
-
Constructor Summary
Constructors Constructor Description InputFormUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static String
formatBD(BigDecimal d)
protected static String
formatBD2(BigDecimal d)
static String
inputForm(Boolean b)
static String
inputForm(Long myLong)
static String
inputForm(Object obj)
static String
inputForm(String s)
static String
inputForm(String fName, int argCount, State state)
Look up a function for the given state by arg count.static String
inputForm(BigDecimal d)
static String
inputForm(FunctionRecord fr)
static String
inputForm(Module m)
static String
inputForm(QDLNull qdlNull)
static String
inputForm(QDLSet set)
static String
inputForm(QDLStem stemVariable)
static String
inputForm(QDLStem stemVariable, int indentFactor)
static String
inputFormModule(String moduleName, State state)
static String
inputFormModule(URI moduleNS, State state)
Finds the input form for a module.static String
inputFormVar(String varName, int indentFactor, State state)
Finds the input form for a variable from the state.static String
inputFormVar(String varName, State state)
protected static boolean
isDBInRange(BigDecimal d)
static void
main(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)
-
-