org.jetbrains.jet.lang.types
Class TypeUtils
java.lang.Object
org.jetbrains.jet.lang.types.TypeUtils
public class TypeUtils
- extends java.lang.Object
|
Method Summary |
static boolean |
canHaveSubtypes(JetTypeChecker typeChecker,
JetType type)
|
static boolean |
dependsOnTypeConstructors(JetType type,
java.util.Collection<TypeConstructor> typeParameterConstructors)
|
static boolean |
dependsOnTypeParameters(JetType type,
java.util.Collection<TypeParameterDescriptor> typeParameters)
|
static boolean |
equalClasses(JetType type1,
JetType type2)
|
static boolean |
equalsOrContainsAsArgument(JetType type,
JetType... possibleArgumentTypes)
|
static boolean |
equalTypes(JetType a,
JetType b)
|
static java.util.List<ClassDescriptor> |
getAllClassDescriptors(JetType type)
|
static java.util.Set<JetType> |
getAllSupertypes(JetType type)
|
static ClassDescriptor |
getClassDescriptor(JetType type)
|
static java.util.List<TypeProjection> |
getDefaultTypeProjections(java.util.List<TypeParameterDescriptor> parameters)
|
static java.util.List<JetType> |
getDefaultTypes(java.util.List<TypeParameterDescriptor> parameters)
|
static java.util.List<JetType> |
getImmediateSupertypes(JetType type)
|
static java.lang.String |
getTypeNameAndStarProjectionsString(java.lang.String name,
int size)
|
static boolean |
hasNullableLowerBound(TypeParameterDescriptor typeParameterDescriptor)
|
static boolean |
hasNullableSuperType(JetType type)
|
static JetType |
intersect(JetTypeChecker typeChecker,
java.util.Set<JetType> types)
|
static boolean |
isIntersectionEmpty(JetType typeA,
JetType typeB)
|
static JetType |
makeNotNullable(JetType type)
|
static JetType |
makeNullable(JetType type)
|
static JetType |
makeNullableAsSpecified(JetType type,
boolean nullable)
|
static JetType |
makeNullableIfNeeded(JetType type,
boolean nullable)
|
static JetType |
makeUnsubstitutedType(ClassDescriptor classDescriptor,
JetScope unsubstitutedMemberScope)
|
static JetType |
substituteParameters(ClassDescriptor clazz,
java.util.List<JetType> actualTypeParameters)
|
static boolean |
typeConstructorUsedInType(TypeConstructor key,
JetType value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NO_EXPECTED_TYPE
public static final JetType NO_EXPECTED_TYPE
TypeUtils
public TypeUtils()
makeNullable
@NotNull
public static JetType makeNullable(@NotNull
JetType type)
makeNotNullable
@NotNull
public static JetType makeNotNullable(@NotNull
JetType type)
makeNullableAsSpecified
@NotNull
public static JetType makeNullableAsSpecified(@NotNull
JetType type,
boolean nullable)
isIntersectionEmpty
public static boolean isIntersectionEmpty(@NotNull
JetType typeA,
@NotNull
JetType typeB)
intersect
@Nullable
public static JetType intersect(@NotNull
JetTypeChecker typeChecker,
@NotNull
java.util.Set<JetType> types)
canHaveSubtypes
public static boolean canHaveSubtypes(JetTypeChecker typeChecker,
JetType type)
makeNullableIfNeeded
public static JetType makeNullableIfNeeded(JetType type,
boolean nullable)
makeUnsubstitutedType
@NotNull
public static JetType makeUnsubstitutedType(ClassDescriptor classDescriptor,
JetScope unsubstitutedMemberScope)
getDefaultTypeProjections
@NotNull
public static java.util.List<TypeProjection> getDefaultTypeProjections(java.util.List<TypeParameterDescriptor> parameters)
getDefaultTypes
@NotNull
public static java.util.List<JetType> getDefaultTypes(java.util.List<TypeParameterDescriptor> parameters)
getImmediateSupertypes
@NotNull
public static java.util.List<JetType> getImmediateSupertypes(@NotNull
JetType type)
getAllSupertypes
@NotNull
public static java.util.Set<JetType> getAllSupertypes(@NotNull
JetType type)
hasNullableLowerBound
public static boolean hasNullableLowerBound(@NotNull
TypeParameterDescriptor typeParameterDescriptor)
hasNullableSuperType
public static boolean hasNullableSuperType(@NotNull
JetType type)
equalClasses
public static boolean equalClasses(@NotNull
JetType type1,
@NotNull
JetType type2)
getClassDescriptor
@Nullable
public static ClassDescriptor getClassDescriptor(@NotNull
JetType type)
substituteParameters
@NotNull
public static JetType substituteParameters(@NotNull
ClassDescriptor clazz,
@NotNull
java.util.List<JetType> actualTypeParameters)
getAllClassDescriptors
@NotNull
public static java.util.List<ClassDescriptor> getAllClassDescriptors(@NotNull
JetType type)
equalTypes
public static boolean equalTypes(@NotNull
JetType a,
@NotNull
JetType b)
typeConstructorUsedInType
public static boolean typeConstructorUsedInType(@NotNull
TypeConstructor key,
@NotNull
JetType value)
dependsOnTypeParameters
public static boolean dependsOnTypeParameters(@NotNull
JetType type,
@NotNull
java.util.Collection<TypeParameterDescriptor> typeParameters)
dependsOnTypeConstructors
public static boolean dependsOnTypeConstructors(@NotNull
JetType type,
@NotNull
java.util.Collection<TypeConstructor> typeParameterConstructors)
equalsOrContainsAsArgument
public static boolean equalsOrContainsAsArgument(@Nullable
JetType type,
@NotNull
JetType... possibleArgumentTypes)
getTypeNameAndStarProjectionsString
@NotNull
public static java.lang.String getTypeNameAndStarProjectionsString(@NotNull
java.lang.String name,
int size)