Package org.qdl_lang.variables.values
Class QDLValue
- java.lang.Object
-
- org.qdl_lang.variables.values.QDLValue
-
- All Implemented Interfaces:
Serializable
,Comparable<QDLValue>
,Constants
- Direct Known Subclasses:
AllIndicesValue
,AxisRestrictionValue
,BooleanValue
,DecimalValue
,DyadicFunctionReferenceValue
,FunctionReferenceValue
,ModuleValue
,QDLKey
,QDLNullValue
,SetValue
public class QDLValue extends Object implements Constants, Serializable, Comparable<QDLValue>
The top-level wrapper class for every value QDL knows about.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AxisExpression
axisValue
protected Boolean
booleanValue
protected BigDecimal
decimalValue
protected DyadicFunctionReferenceNode
dyadicFunctionValue
protected FunctionReferenceNode
functionValue
protected Long
longValue
protected Module
moduleValue
protected QDLNull
nullValue
protected QDLSet
setValue
protected QDLStem
stemValue
protected String
stringValue
-
Fields inherited from interface org.qdl_lang.variables.Constants
ALL_INDICES_NAME, ALL_INDICES_TYPE, ARG_COUNT_TYPE, AXIS_RESTRICTION_NAME, AXIS_RESTRICTION_TYPE, BOOLEAN_NAME, BOOLEAN_TYPE, DECIMAL_NAME, DECIMAL_TYPE, DYADIC_FUNCTION_NAME, DYADIC_FUNCTION_TYPE, FUNCTION_NAME, FUNCTION_TYPE, INTEGER_TYPE, LIST_NAME, LIST_TYPE, LONG_NAME, LONG_TYPE, MODULE_NAME, MODULE_TYPE, NULL_NAME, NULL_TYPE, SET_NAME, SET_TYPE, STEM_NAME, STEM_TYPE, STRING_NAME, STRING_TYPE, UNKNOWN_NAME, UNKNOWN_TYPE
-
-
Method Summary
-
-
-
Field Detail
-
longValue
protected Long longValue
-
booleanValue
protected Boolean booleanValue
-
decimalValue
protected BigDecimal decimalValue
-
stringValue
protected String stringValue
-
moduleValue
protected Module moduleValue
-
functionValue
protected FunctionReferenceNode functionValue
-
dyadicFunctionValue
protected DyadicFunctionReferenceNode dyadicFunctionValue
-
axisValue
protected AxisExpression axisValue
-
setValue
protected QDLSet setValue
-
stemValue
protected QDLStem stemValue
-
nullValue
protected QDLNull nullValue
-
-
Constructor Detail
-
QDLValue
public QDLValue(Object value)
-
-
Method Detail
-
getValue
public Object getValue()
-
setValue
public void setValue(Object value)
-
hasValue
public boolean hasValue()
-
getType
public int getType()
-
isAxisRestriction
public boolean isAxisRestriction()
-
isBoolean
public boolean isBoolean()
-
isDecimal
public boolean isDecimal()
-
isDyadicFunction
public boolean isDyadicFunction()
-
isFunction
public boolean isFunction()
-
isList
public boolean isList()
-
isListOrStem
public boolean isListOrStem()
-
isLong
public boolean isLong()
-
isModule
public boolean isModule()
-
isNull
public boolean isNull()
-
isSet
public boolean isSet()
-
isStem
public boolean isStem()
-
isString
public boolean isString()
-
isAllIndices
public boolean isAllIndices()
-
asBoolean
public Boolean asBoolean()
-
asDecimal
public BigDecimal asDecimal()
-
asStem
public QDLStem asStem()
-
asString
public String asString()
-
asNull
public QDLNull asNull()
-
asSet
public QDLSet asSet()
-
asModule
public Module asModule()
-
asLong
public Long asLong()
-
asFunction
public FunctionReferenceNode asFunction()
-
asDyadicFunction
public DyadicFunctionReferenceNode asDyadicFunction()
-
asAxisExpression
public AxisExpression asAxisExpression()
-
getInputForm
public String getInputForm()
-
getNullValue
public static QDLNullValue getNullValue()
-
asQDLValue
public static QDLValue asQDLValue(Object value)
Factory method to convert an object to aQDLValue
if it is not one.- Parameters:
value
-- Returns:
-
asJavaValue
public static Object asJavaValue(Object value)
effectively the inverse ofasQDLValue(Object)
. If this isQDLValue
it will unwrap the value, otherwise it just returns the argument.- Parameters:
value
-- Returns:
-
castToJavaValues
public static List<Object> castToJavaValues(List<QDLValue> values)
Utility to convert a collection ofQDLValue
s to their Java objects.- Parameters:
values
-- Returns:
-
castToQDLValues
public static List<QDLValue> castToQDLValues(List<Object> values)
Inverse cast ofcastToJavaValues(List)
. This takes a collection of java values and turns it into a list ofQDLValue
s- Parameters:
values
-- Returns:
-
castToQDLValues
public static Collection<QDLValue> castToQDLValues(Collection<Object> values)
-
compareTo
public int compareTo(QDLValue qdlValue)
- Specified by:
compareTo
in interfaceComparable<QDLValue>
-
isScalar
public boolean isScalar()
-
-