protected static class Operator.DescriptorComparison
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
areCompatible |
(package private) boolean |
areNumbers |
(package private) char |
compatibleType |
(package private) static Operator.DescriptorComparison |
INCOMPATIBLE_NUMBERS |
(package private) static Operator.DescriptorComparison |
NOT_NUMBERS |
Modifier | Constructor and Description |
---|---|
private |
DescriptorComparison(boolean areNumbers,
boolean areCompatible,
char compatibleType) |
Modifier and Type | Method and Description |
---|---|
static Operator.DescriptorComparison |
checkNumericCompatibility(java.lang.String leftDeclaredDescriptor,
java.lang.String rightDeclaredDescriptor,
java.lang.String leftActualDescriptor,
java.lang.String rightActualDescriptor)
Return an object that indicates whether the input descriptors are compatible.
|
static final Operator.DescriptorComparison NOT_NUMBERS
static final Operator.DescriptorComparison INCOMPATIBLE_NUMBERS
final boolean areNumbers
final boolean areCompatible
final char compatibleType
private DescriptorComparison(boolean areNumbers, boolean areCompatible, char compatibleType)
public static Operator.DescriptorComparison checkNumericCompatibility(java.lang.String leftDeclaredDescriptor, java.lang.String rightDeclaredDescriptor, java.lang.String leftActualDescriptor, java.lang.String rightActualDescriptor)
A declared descriptor is what could statically be determined (e.g. from looking at the return value of a property accessor method) whilst an actual descriptor is the type of an actual object that was returned, which may differ.
For generic types with unbound type variables, the declared descriptor discovered may be 'Object' but from the actual descriptor it is possible to observe that the objects are really numeric values (e.g. ints).
leftDeclaredDescriptor
- the statically determinable left descriptorrightDeclaredDescriptor
- the statically determinable right descriptorleftActualDescriptor
- the dynamic/runtime left object descriptorrightActualDescriptor
- the dynamic/runtime right object descriptor