Package com._1c.g5.v8.dt.ql
Class QlTypesComparator
- java.lang.Object
-
- com._1c.g5.v8.dt.ql.QlTypesComparator
-
- All Implemented Interfaces:
ITypesComparator
public final class QlTypesComparator extends Object implements ITypesComparator
Implements comparator for type in Ql language. This class using inQlTypeSystem
andQlCheckerExpression
. Helps to validate type of expression in Ql- See Also:
ITypesComparator
-
-
Constructor Summary
Constructors Constructor Description QlTypesComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compare(TypeDescription expectedType, List<TypeDescription> allExpectedCastingType, TypeDescription getType)
Comparator types for Ql languageboolean
compare(TypeDescription expectedType, List<TypeDescription> allExpectedCastingType, TypeDescriptionSource getType)
This function compare expected and got type of expressionboolean
equalType(TypeDescription typeF, TypeDescription typeS)
Check for equal type in ql languageboolean
equalTypeItem(TypeItem typeItemF, TypeItem typeItemS)
Compare two type items withEcoreUtil
for equalsboolean
isArbitraryType(TypeDescription type)
Check for Arbitrary type in Ql languageboolean
isCrossCompoundType(TypeDescription compoundTypeF, TypeDescription compoundTypeS)
Is there intersection between compound typeboolean
isRefType(AbstractExpression expr, TypeDescriptionSource type)
Check for reference typeexpr
andtype
boolean
isValueStorageType(TypeDescription type)
Check for type 'ValueStorage'boolean
isValueStorageType(TypeDescriptionSource type)
-
-
-
Method Detail
-
compare
public boolean compare(TypeDescription expectedType, List<TypeDescription> allExpectedCastingType, TypeDescription getType)
Comparator types for Ql language- Specified by:
compare
in interfaceITypesComparator
- Parameters:
expectedType
- expected type of expression in the point of calling this functionallExpectedCastingType
- all types forexprectedType
which it can be replacedgetType
- got type of expression in the point of calling this function- Returns:
true
, ifgetType
equals or can be casting toexprectedType
-
compare
public boolean compare(TypeDescription expectedType, List<TypeDescription> allExpectedCastingType, TypeDescriptionSource getType)
Description copied from interface:ITypesComparator
This function compare expected and got type of expression- Specified by:
compare
in interfaceITypesComparator
- Parameters:
expectedType
- expected type of expression in the point of calling this functionallExpectedCastingType
- all types forexprectedType
which it can be replacedgetType
- got type of expression in the point of calling this function- Returns:
true
, ifgetType
equals or can be casting toexprectedType
-
isArbitraryType
public boolean isArbitraryType(TypeDescription type)
Check for Arbitrary type in Ql language- Specified by:
isArbitraryType
in interfaceITypesComparator
- Parameters:
type
- checking type- Returns:
- true, if type is arbitrary i.e it equals for all type
-
equalType
public boolean equalType(TypeDescription typeF, TypeDescription typeS)
Check for equal type in ql language- Specified by:
equalType
in interfaceITypesComparator
- Parameters:
typeF
- - comparing typetypeS
- - comparing type- Returns:
true
, iftypeF
equaltypeS
-
isCrossCompoundType
public boolean isCrossCompoundType(TypeDescription compoundTypeF, TypeDescription compoundTypeS)
Is there intersection between compound type- Parameters:
compoundTypeF
- checking compound type, can't benull
compoundTypeS
- checking compound type, can't benull
- Returns:
true
, if intersection was detected,false
otherwise
-
isValueStorageType
public boolean isValueStorageType(TypeDescription type)
Check for type 'ValueStorage'- Parameters:
type
- checking type- Returns:
- true, if type equal with valueStorage
-
isValueStorageType
public boolean isValueStorageType(TypeDescriptionSource type)
-
isRefType
public boolean isRefType(AbstractExpression expr, TypeDescriptionSource type)
Check for reference typeexpr
andtype
- Parameters:
expr
- checking expressiontype
- checking type- Returns:
- true, if
expr
ortype
is reference type
-
-