Modifier and Type | Field and Description |
---|---|
protected boolean |
isBreakValue |
protected boolean |
isContinueValue |
protected boolean |
isEmptyReturnValue |
protected boolean |
isReturnValue
marks if a value calculated in a method/function terminates the method/function, effectively forcing a return from it
|
protected boolean |
isValid
marks if the value is valid (already set to a useful value)
(normally true, false if a value exists but is not really set (used in case of variables/parameters))
|
static int |
kTYPE_BOOL |
static int |
kTYPE_COLOR |
static int |
kTYPE_ID |
static int |
kTYPE_LAMBDA |
static int |
kTYPE_LIST |
static int |
kTYPE_NULL |
static int |
kTYPE_NUMERIC |
static int |
kTYPE_PRG |
static int |
kTYPE_STRING |
static int |
kTYPE_UNKNOWN |
static int |
kTYPE_VALUE |
static int |
kTYPE_VOID |
protected int |
type
the type of the Value
|
Constructor and Description |
---|
UPLValue() |
Modifier and Type | Method and Description |
---|---|
UPLValue |
add(UPLValue v)
Implements the addition of this UPLValue with the given value.
|
UPLValue |
affirmate()
Affirmates (unary +) a UPLValue.
|
UPLBool |
castableAs(int toType,
de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) |
UPLValue |
castAs(int toType,
de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) |
static UPLValue |
castValueToType(de.infinityloop.upcast.util.namespace.NamespaceManager nsm,
int targetType,
UPLValue value)
Performs a cast of the passed value to the specified type.
|
static UPLValue |
coerceToType(int type,
de.infinityloop.upcast.util.namespace.QualifiedName qualifiedName,
UPLValue value)
This method coerces a given value to the type fitting the given symbol.
|
abstract int |
compareTo(int compareType,
UPLValue to)
Compares this object with the specified object for order.
|
UPLValue |
decrement()
unary decrement.
|
abstract UPLValue |
deepCopy()
Creates a deep copy of a UPLValue.
|
UPLValue |
div(UPLValue v)
Implements the division of this value and the given UPLValue.
|
boolean |
equals(UPLValue to) |
UPLValue |
eval(de.infinityloop.upcast.upl.util.Context context) |
abstract java.lang.String |
getAsString() |
abstract java.lang.String |
getAsUPL() |
abstract java.lang.String |
getDebugString() |
abstract boolean |
getEffectiveBooleanValue()
The effective boolean value of an UPLValue as per the XPath spec.
|
static int |
getInstanceofDistance(UPLValue value,
int type)
This function returns if the given value is exactly of a type or derived from the type
|
int |
getType()
Return the type of the value.
|
static int |
getType(java.lang.String name) |
java.lang.String |
getTypeName() |
static java.lang.String |
getTypeName(int i) |
UPLValue |
increment()
unary increment.
|
boolean |
isBreakValue() |
boolean |
isContinueValue() |
boolean |
isEmptyReturnValue() |
boolean |
isReturnValue() |
boolean |
isValid()
Returns if this value is already set to a useful value.
|
static int |
matchRating(int expectedType,
int actualType)
Returns if a value of a given type matches the expected type.
|
UPLValue |
mod(UPLValue v) |
UPLValue |
negate()
Negates (unary minus) a UPLValue.
|
UPLValue |
not() |
void |
setBreakValue(boolean isBreakValue) |
void |
setContinueValue(boolean isContinueValue) |
void |
setEmptyReturnValue(boolean isEmptyReturnValue) |
void |
setReturnValue(boolean isReturnValue)
sets whether this value if calculated in a method/function terminates the method/function, effectively forcing a return from it
|
void |
setValid(boolean isValid)
Sets if this value is set to a useful value.
|
UPLValue |
sub(UPLValue v)
Implements the subtraction of the given UPLValue from this value.
|
UPLValue |
times(UPLValue v)
Implements the multiplication of the given UPLValue with this value.
|
java.lang.String |
toString()
used for debugging purposes
|
public static final int kTYPE_VOID
public static final int kTYPE_UNKNOWN
public static final int kTYPE_VALUE
public static final int kTYPE_NULL
public static final int kTYPE_ID
public static final int kTYPE_STRING
public static final int kTYPE_NUMERIC
public static final int kTYPE_BOOL
public static final int kTYPE_COLOR
public static final int kTYPE_LIST
public static final int kTYPE_PRG
public static final int kTYPE_LAMBDA
protected int type
protected boolean isValid
protected boolean isReturnValue
protected boolean isEmptyReturnValue
protected boolean isBreakValue
protected boolean isContinueValue
public UPLValue eval(de.infinityloop.upcast.upl.util.Context context) throws UPLValueException
UPLValueException
public abstract UPLValue deepCopy() throws UPLValueException
UPLValueException
public static final int matchRating(int expectedType, int actualType)
expectedType
- the expected typeactualType
- the actual typepublic final UPLValue not() throws UPLValueException
UPLValueException
public final boolean equals(UPLValue to) throws UPLValueException
to
- UPLValueException
public abstract int compareTo(int compareType, UPLValue to) throws UPLValueException
compareType
- see RelationalExpr: kEQ, kNEQ, kLT, kGT, kLTEQ, kGTEQto
- the Object to be comparedUPLValueException
public UPLValue affirmate() throws UPLValueException
UPLValueException
public UPLValue negate() throws UPLValueException
UPLValueException
public UPLValue castAs(int toType, de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) throws UPLValueException
UPLValueException
public UPLBool castableAs(int toType, de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) throws UPLValueException
UPLValueException
public UPLValue increment() throws UPLValueException
UPLValueException
UPLValueException
public UPLValue decrement() throws UPLValueException
UPLValueException
UPLValueException
public abstract boolean getEffectiveBooleanValue() throws UPLValueException
UPLValueException
public UPLValue add(UPLValue v) throws UPLValueException
v
- the value to be addedUPLValueException
public UPLValue sub(UPLValue v) throws UPLValueException
v
- the value to subtractUPLValueException
public UPLValue times(UPLValue v) throws UPLValueException
v
- the value to be used as factorUPLValueException
public UPLValue div(UPLValue v) throws UPLValueException
v
- the value to be used as divisorUPLValueException
public UPLValue mod(UPLValue v) throws UPLValueException
UPLValueException
public abstract java.lang.String getAsString()
public abstract java.lang.String getAsUPL()
public final java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public abstract java.lang.String getDebugString()
public int getType()
public java.lang.String getTypeName()
public static java.lang.String getTypeName(int i)
public static int getType(java.lang.String name)
public static int getInstanceofDistance(UPLValue value, int type)
value
- the value to be testedtype
- the type to be used as referencepublic boolean isReturnValue()
public void setReturnValue(boolean isReturnValue)
isReturnValue
- public boolean isEmptyReturnValue()
public void setEmptyReturnValue(boolean isEmptyReturnValue)
public boolean isBreakValue()
public void setBreakValue(boolean isBreakValue)
public boolean isContinueValue()
public void setContinueValue(boolean isContinueValue)
public boolean isValid()
public void setValid(boolean isValid)
isValid
- public static UPLValue castValueToType(de.infinityloop.upcast.util.namespace.NamespaceManager nsm, int targetType, UPLValue value) throws UPLValueException
targetType
- the type to convert tovalue
- UPLValueException
public static UPLValue coerceToType(int type, de.infinityloop.upcast.util.namespace.QualifiedName qualifiedName, UPLValue value) throws de.infinityloop.upcast.upl.prg.UPLEvalException
symbol
- value
- the value to be coercedde.infinityloop.upcast.upl.prg.UPLEvalException
- if the value could not be coerced