protected final boolean checkAssignmentBound(TType rhs) { if (fBounds.length == 0) return true; for (int i= 0; i < fBounds.length; i++) { if (rhs.canAssignTo(fBounds[i])) return true; } return false; }
protected final boolean checkAssignmentBound(TType rhs) { if (fBounds.length == 0) return true; for (int i= 0; i < fBounds.length; i++) { if (rhs.canAssignTo(fBounds[i])) return true; } return false; }
protected final boolean checkAssignmentBound(TType rhs) { if (fBounds.length == 0) return true; for (int i= 0; i < fBounds.length; i++) { if (rhs.canAssignTo(fBounds[i])) return true; } return false; }
private boolean canAssignFirstBoundTo(TType lhs) { if (fBounds.length > 0 && fBounds[0].isArrayType()) { // capture of ? extends X[] return fBounds[0].canAssignTo(lhs); } return false; }
protected final boolean canAssignOneBoundTo(TType lhs) { if (fBounds.length == 0) return lhs.isJavaLangObject(); for (int i= 0; i < fBounds.length; i++) { if (fBounds[i].canAssignTo(lhs)) return true; } return false; }
protected final boolean canAssignOneBoundTo(TType lhs) { if (fBounds.length == 0) return lhs.isJavaLangObject(); for (int i= 0; i < fBounds.length; i++) { if (fBounds[i].canAssignTo(lhs)) return true; } return false; }
private boolean canAssignFirstBoundTo(TType lhs) { if (fBounds.length > 0 && fBounds[0].isArrayType()) { // capture of ? extends X[] return fBounds[0].canAssignTo(lhs); } return false; }
protected final boolean canAssignOneBoundTo(TType lhs) { if (fBounds.length == 0) return lhs.isJavaLangObject(); for (int i= 0; i < fBounds.length; i++) { if (fBounds[i].canAssignTo(lhs)) return true; } return false; }
@Override protected boolean checkAssignmentBound(TType rhs) { // ? super Number is a set of all super types of number including // Number. So I can only assign objects which are a subtype of // Number. return rhs.canAssignTo(getBound()); }
protected boolean checkAssignmentBound(TType rhs) { // ? super Number is a set of all super types of number including // Number. So I can only assign objects which are a subtype of // Number. return rhs.canAssignTo(getBound()); }
@Override protected boolean checkAssignmentBound(TType rhs) { // ? super Number is a set of all super types of number including // Number. So I can only assign objects which are a subtype of // Number. return rhs.canAssignTo(getBound()); }
private boolean canAssignFirstBoundTo(TType lhs) { if (fBounds.length > 0 && fBounds[0].isArrayType()) { // capture of ? extends X[] return fBounds[0].canAssignTo(lhs); } return false; }
/** * Tests if two types are assign compatible. Void types are never compatible. * * @param typeToAssign The binding of the type to assign * @param definedType The type of the object that is assigned * @return <code>true</code> iff definedType = typeToAssign is a valid assignment */ public static boolean canAssign(ITypeBinding typeToAssign, ITypeBinding definedType) { TypeEnvironment typeEnvironment= new TypeEnvironment(false, true); TType defined= typeEnvironment.create(definedType); TType toAssign= typeEnvironment.create(typeToAssign); return toAssign.canAssignTo(defined); }
/** * Tests if two types are assign compatible. Void types are never compatible. * * @param typeToAssign The binding of the type to assign * @param definedType The type of the object that is assigned * @return <code>true</code> iff definedType = typeToAssign is a valid assignment */ public static boolean canAssign(ITypeBinding typeToAssign, ITypeBinding definedType) { TypeEnvironment typeEnvironment= new TypeEnvironment(false, true); TType defined= typeEnvironment.create(definedType); TType toAssign= typeEnvironment.create(typeToAssign); return toAssign.canAssignTo(defined); }
private boolean canAssignToArrayType(ArrayType lhs) { if (fDimensions == lhs.fDimensions) { // primitive type don't have any conversion for arrays. if (fElementType.getKind() == PRIMITIVE_TYPE || lhs.fElementType.getKind() == PRIMITIVE_TYPE) return fElementType.isTypeEquivalentTo(lhs.fElementType); return fElementType.canAssignTo(lhs.fElementType); } if (fDimensions < lhs.fDimensions) return false; return isArrayLhsCompatible(lhs.fElementType); }
protected boolean checkLowerBound(TType rhs) { if (! getWildcard().isSuperWildcardType()) return false; return rhs.canAssignTo(getWildcard().getBound()); }
private boolean canAssignToArrayType(ArrayType lhs) { if (fDimensions == lhs.fDimensions) { // primitive type don't have any conversion for arrays. if (fElementType.getKind() == PRIMITIVE_TYPE || lhs.fElementType.getKind() == PRIMITIVE_TYPE) return fElementType.isTypeEquivalentTo(lhs.fElementType); return fElementType.canAssignTo(lhs.fElementType); } if (fDimensions < lhs.fDimensions) return false; return isArrayLhsCompatible(lhs.fElementType); }
private boolean canAssignToArrayType(ArrayType lhs) { if (fDimensions == lhs.fDimensions) { // primitive type don't have any conversion for arrays. if (fElementType.getKind() == PRIMITIVE_TYPE || lhs.fElementType.getKind() == PRIMITIVE_TYPE) return fElementType.isTypeEquivalentTo(lhs.fElementType); return fElementType.canAssignTo(lhs.fElementType); } if (fDimensions < lhs.fDimensions) return false; return isArrayLhsCompatible(lhs.fElementType); }
protected boolean checkLowerBound(TType rhs) { if (! getWildcard().isSuperWildcardType()) return false; return rhs.canAssignTo(getWildcard().getBound()); }
protected boolean checkLowerBound(TType rhs) { if (! getWildcard().isSuperWildcardType()) return false; return rhs.canAssignTo(getWildcard().getBound()); }