public class OwExprExpressionType extends Object
Compiled expression-type class.
Compiled expressions might result in multiple value types (see OwExprType
) (the resulted type
depends on the properties and function types which are discovered at evaluation time). Objects of
OwExprExpressionType
are a collection of possible value types - called inferred types -
(see OwExprType
) an expression might result in.
Expression types are produced during compilation time and they change (that is to say they are
regressed) as sub expression or operands are parsed and added to the holding expression.
The expression types are regressed based on operator conversion tables and sub expression types.
Example:
1+a=c
In the above expression the operator =
is applied to operands 1+a
and c
.
According to +
conversion table 1+a
can only result in {STRING,NUMERIC,TIME,DATE}.
According to the =
conversion table this operator results in a BOOLEAN value always so
the resulted expression-type will be a BOOLEAN.
The same conversion table the operands must be the same or at least one should be a STRING or NULL
so the expression-type of 1+a
and c
should be {STRING,NUMERIC,TIME,DATE}.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Field and Description |
---|---|
protected Set |
m_inferringTypes
Types that can be inferred from this expression type.
|
static OwExprExpressionType |
NOTYPE |
Constructor and Description |
---|
OwExprExpressionType(Collection inferringTypes_p)
Constructor
|
OwExprExpressionType(OwExprType type_p)
Constructor
|
OwExprExpressionType(OwExprType[] inferringTypes_p)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
canInfer(OwExprType type_p) |
boolean |
equals(Object obj_p) |
Set |
getInferringTypes() |
int |
hashCode() |
static String |
printTypes(OwExprExpressionType[] types_p)
Pretty printer of types
|
void |
regressTo(OwExprExpressionType expressionType_p)
Regresses (diminishes the possible types represented by this
OwExprExpression )
this expression type to the types represented the argument expressionType_p |
String |
toString() |
public static final OwExprExpressionType NOTYPE
protected Set m_inferringTypes
public OwExprExpressionType(OwExprType type_p)
type_p
- the only inferred typepublic OwExprExpressionType(OwExprType[] inferringTypes_p)
inferringTypes_p
- array of initially inferred typespublic OwExprExpressionType(Collection inferringTypes_p)
inferringTypes_p
- collection of initially inferred typespublic static final String printTypes(OwExprExpressionType[] types_p)
types_p
- public void regressTo(OwExprExpressionType expressionType_p) throws OwExprTypeMissmatchException
OwExprExpression
)
this expression type to the types represented the argument expressionType_p
expressionType_p
- types to regress this expression type toOwExprTypeMissmatchException
- if the regression process fails (type incompatibility-
the expressionType_p types can't be combined in a subset of
the types represented by this expression type )public boolean canInfer(OwExprType type_p)
type_p
- public final Set getInferringTypes()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.