Package org.qdl_lang.variables
Class StemUtility
- java.lang.Object
-
- org.qdl_lang.variables.StemUtility
-
public class StemUtility extends Object
Created by Jeff Gaynor
on 3/24/21 at 12:38 PM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
StemUtility.DyadAxisAction
Action to be applied at a given axis.static interface
StemUtility.StemAxisWalkerAction1
For operations that return a stem.
-
Field Summary
Fields Modifier and Type Field Description protected static int
BOOLEAN_TYPE
protected static int
DOUBLE_TYPE
protected static int
FLOAT_TYPE
protected static int
INT_TYPE
static Long
LAST_AXIS_ARGUMENT_VALUE
protected static int
LIST_TYPE
protected static int
LONG_TYPE
protected static int
MAP_TYPE
protected static int
STRING_TYPE
protected static int
UNKOWN_TYPE
-
Constructor Summary
Constructors Constructor Description StemUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
areAllStems(Object... objects)
static boolean
areNoneStems(Object... objects)
static void
axisDayadRecursion(QDLStem out0, QDLStem left0, QDLStem right0, int depth, boolean maxDepth, StemUtility.DyadAxisAction axisAction)
Apply some action along an axis.static Object
axisWalker(QDLStem inStem, int depth, StemUtility.StemAxisWalkerAction1 walker)
Recurses through stem that has arbitrary rank.protected static Object
convert(Object value)
static void
doNodeSurgery(ExpressionStemNode ESN, State state)
static void
formatList(QDLStem stem)
protected static int
getType(Object obj)
static boolean
isStem(Object o)
static QDLStem
listToStem(List list)
static void
main(String[] args)
static QDLStem
mapToStem(Map map)
Convert a generic map to a stemstatic QDLStem
mapToStem(QDLStem out, Map map)
static String
stemListToString(QDLStem contents, boolean forceToString)
Convert a stem list to a string, separated by line feeds.
-
-
-
Field Detail
-
LAST_AXIS_ARGUMENT_VALUE
public static final Long LAST_AXIS_ARGUMENT_VALUE
-
UNKOWN_TYPE
protected static final int UNKOWN_TYPE
- See Also:
- Constant Field Values
-
INT_TYPE
protected static final int INT_TYPE
- See Also:
- Constant Field Values
-
FLOAT_TYPE
protected static final int FLOAT_TYPE
- See Also:
- Constant Field Values
-
DOUBLE_TYPE
protected static final int DOUBLE_TYPE
- See Also:
- Constant Field Values
-
LONG_TYPE
protected static final int LONG_TYPE
- See Also:
- Constant Field Values
-
BOOLEAN_TYPE
protected static final int BOOLEAN_TYPE
- See Also:
- Constant Field Values
-
STRING_TYPE
protected static final int STRING_TYPE
- See Also:
- Constant Field Values
-
LIST_TYPE
protected static final int LIST_TYPE
- See Also:
- Constant Field Values
-
MAP_TYPE
protected static final int MAP_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isStem
public static boolean isStem(Object o)
-
areNoneStems
public static boolean areNoneStems(Object... objects)
-
areAllStems
public static boolean areAllStems(Object... objects)
-
axisDayadRecursion
public static void axisDayadRecursion(QDLStem out0, QDLStem left0, QDLStem right0, int depth, boolean maxDepth, StemUtility.DyadAxisAction axisAction)
Apply some action along an axis. This will recurse to a given axis and apply an action there- Parameters:
out0
-left0
-right0
-depth
-maxDepth
-axisAction
-
-
axisWalker
public static Object axisWalker(QDLStem inStem, int depth, StemUtility.StemAxisWalkerAction1 walker)
Recurses through stem that has arbitrary rank.- Parameters:
inStem
-depth
-walker
-- Returns:
-
doNodeSurgery
public static void doNodeSurgery(ExpressionStemNode ESN, State state)
-
formatList
public static void formatList(QDLStem stem)
-
main
public static void main(String[] args)
-
stemListToString
public static String stemListToString(QDLStem contents, boolean forceToString)
Convert a stem list to a string, separated by line feeds. IfforceToString
is true, then every elements toString is called, otherwise, if the element is not a string, an exception is thrown.- Parameters:
contents
-forceToString
-- Returns:
-
mapToStem
public static QDLStem mapToStem(Map map)
Convert a generic map to a stem- Parameters:
map
-- Returns:
-
getType
protected static int getType(Object obj)
-
-