/** * Returns <code>true</code> if the given type represents a primitive type. * Otherwise <code>false</code> is returned. * * @return whether this type is a primitive type or not */ public final boolean isPrimitiveType() { return getKind() == PRIMITIVE_TYPE; }
/** * Returns <code>true</code> if the given type represents an array type. * Otherwise <code>false</code> is returned. * * @return whether this type is an array type or not */ public final boolean isArrayType() { return getKind() == ARRAY_TYPE; }
/** * Returns <code>true</code> if the given type represents an extends wildcard type. * Otherwise <code>false</code> is returned. * * @return whether this type is an extends wildcard type or not */ public final boolean isExtendsWildcardType() { return getKind() == EXTENDS_WILDCARD_TYPE; }
/** * Returns <code>true</code> if the given type represents an array type. * Otherwise <code>false</code> is returned. * * @return whether this type is an array type or not */ public final boolean isArrayType() { return getKind() == ARRAY_TYPE; }
/** * Returns <code>true</code> if the given type represents a raw type. * Otherwise <code>false</code> is returned. * * @return whether this type is a raw type or not */ public final boolean isRawType() { return getKind() == RAW_TYPE; }
/** * Returns <code>true</code> if the given type represents a wildcard type. * Otherwise <code>false</code> is returned. * * @return whether this type is a wildcard type or not */ public final boolean isWildcardType() { int elementType= getKind(); return elementType == EXTENDS_WILDCARD_TYPE || elementType == UNBOUND_WILDCARD_TYPE || elementType == SUPER_WILDCARD_TYPE; }
/** * Returns <code>true</code> if the given type represents an extends wildcard type. * Otherwise <code>false</code> is returned. * * @return whether this type is an extends wildcard type or not */ public final boolean isExtendsWildcardType() { return getKind() == EXTENDS_WILDCARD_TYPE; }
/** * Returns <code>true</code> if the given type represents the void type. * Otherwise <code>false</code> is returned. * * @return whether this type is the void type or not */ public final boolean isVoidType() { return getKind() == VOID_TYPE; }
/** * Returns <code>true</code> if the given type represents a hierarchy type. * Otherwise <code>false</code> is returned. * * @return whether this type is a hierarchy type or not */ public final boolean isHierarchyType() { int elementType= getKind(); return elementType == RAW_TYPE || elementType == PARAMETERIZED_TYPE || elementType == GENERIC_TYPE || elementType == STANDARD_TYPE; }
protected boolean doCanAssignTo(TType lhs) { int kind= lhs.getKind(); return kind != PRIMITIVE_TYPE && kind != VOID_TYPE; } }
/** * Returns <code>true</code> if the given type represents a type variable. * Otherwise <code>false</code> is returned. * * @return whether this type is a type variable or not */ public final boolean isTypeVariable() { return getKind() == TYPE_VARIABLE; }
/** * Returns <code>true</code> if the given type represents a unbound wildcard type. * Otherwise <code>false</code> is returned. * * @return whether this type is a unbound wildcard type or not */ public final boolean isUnboundWildcardType() { return getKind() == UNBOUND_WILDCARD_TYPE; }
/** * Returns <code>true</code> if the given type represents a standard type. * Otherwise <code>false</code> is returned. * * @return whether this type is a standard type or not */ public final boolean isStandardType() { return getKind() == STANDARD_TYPE; }
/** * Returns <code>true</code> if the given type represents a raw type. * Otherwise <code>false</code> is returned. * * @return whether this type is a raw type or not */ public final boolean isRawType() { return getKind() == RAW_TYPE; }
/** * Returns <code>true</code> if the given type represents a generic type. * Otherwise <code>false</code> is returned. * * @return whether this type is a generic type or not */ public final boolean isGenericType() { return getKind() == GENERIC_TYPE; }
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 doExtends(TypeVariable other) { for (int i= 0; i < fBounds.length; i++) { TType bound= fBounds[i]; if (other.equals(bound) || (bound.getKind() == TYPE_VARIABLE && ((TypeVariable)bound).doExtends(other))) return true; } return false; }
@Override protected boolean isTypeEquivalentTo(TType other) { int otherElementType= other.getKind(); if (otherElementType == RAW_TYPE || otherElementType == PARAMETERIZED_TYPE) return getErasure().isTypeEquivalentTo(other.getErasure()); return super.isTypeEquivalentTo(other); }