public final class TemplatizedType extends ProxyObjectType
Array<string>.JSType.HasPropertyKind, JSType.SubtypingMode, JSType.TypePairTypeI.Nullability, TypeI.TypeInferencetemplateTypeMap| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<ObjectType> |
getCtorExtendedInterfaces()
Gets the interfaces extended by the interface associated with this type.
|
java.lang.Iterable<ObjectType> |
getCtorImplementedInterfaces()
Gets the interfaces implemented by the ctor associated with this type.
|
JSType |
getPropertyType(java.lang.String propertyName)
Gets the property type of the property whose name is given.
|
ObjectType |
getReferencedType() |
TemplateTypeMap |
getTemplateTypeMap()
Returns the template type map associated with this type.
|
com.google.common.collect.ImmutableList<JSType> |
getTemplateTypes()
Gets the declared default element type.
|
boolean |
hasAnyTemplateTypesInternal() |
int |
hashCode() |
boolean |
isSubtype(JSType that)
Checks whether
this is a subtype of that. |
protected boolean |
isSubtype(JSType that,
com.google.javascript.rhino.jstype.JSType.ImplCache implicitImplCache,
JSType.SubtypingMode subtypingMode)
checking isSubtype with structural interface matching
|
TemplatizedType |
toMaybeTemplatizedType()
Downcasts this to a TemplatizedType, or returns null if this is not
a function.
|
<T> T |
visit(Visitor<T> visitor)
Visit this type with the given visitor.
|
canBeCalled, collapseUnion, findPropertyType, getConstructor, getImplicitPrototype, getJSDocInfo, getOwnerFunction, getPropertyKind, getReferenceName, getTypeOfThis, hasReferenceName, isAllType, isCheckedUnknownType, isConstructor, isDict, isInstanceType, isInterface, isNativeObjectType, isNominalType, isNoObjectType, isNoResolvedType, isNoType, isNullable, isOrdinaryFunction, isStruct, isStructuralType, isUnknownType, isVoidable, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchesSymbolContext, removeProperty, setJSDocInfo, setPropertyJSDocInfo, setValidator, testForEquality, toDebugHashCodeString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeRecordType, toMaybeTemplateType, toMaybeUnionType, visitReferenceTypecast, clearCachedValues, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, getDisplayName, getEnumeratedTypeOfEnumObject, getInstantiatedTypeArgument, getLegacyResolvedType, getNormalizedReferenceName, getOwnPropertyDefSite, getOwnPropertyJSDocInfo, getOwnPropertyKind, getOwnPropertyNames, getOwnSlot, getParentScope, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyDefSite, getPropertyJSDocInfo, getPropertyNames, getPropertyNode, getPropertyTypeMap, getPrototypeObject, getRawType, getSlot, getSuperClassConstructor, getTopDefiningInterface, hasCachedValues, hasOwnProperty, instantiateGenericsWithUnknown, isAmbiguousObject, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, normalizeObjectForCheckAccessControls, setPropertyNode, withoutStrayPropertiesautobox, autoboxAndGetObject, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, containsArray, dereference, differsFrom, equals, extendTemplateTypeMap, getEnumeratedTypeOfEnumElement, getGreatestSubtype, getGreatestSubtypeWithProperty, getLeastSupertype, getPropertyKind, getRestrictedTypeGivenToBooleanOutcome, getTypeParameters, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, getUnionMembers, hasAnyTemplateTypes, hasDisplayName, hasProperty, isArrayType, isBooleanObjectType, isBooleanValueType, isBottom, isBoxableScalar, isDateType, isEmptyType, isEnumElement, isEnumElementType, isEnumObject, isEnumType, isEquivalent, isEquivalentTo, isEquivalentTo, isExplicitlyVoidable, isFullyInstantiated, isFunctionType, isGenericObjectType, isGlobalThisType, isInstanceofObject, isLegacyNamedType, isLiteralObject, isNamedType, isNominalConstructor, isNullType, isNumber, isNumberObjectType, isNumberValueType, isObjectType, isPartiallyInstantiated, isPrototypeObject, isRecordType, isRegexpType, isResolved, isSomeUnknownType, isString, isStringObjectType, isStringValueType, isStructuralInterface, isSubtype, isSubtypeOf, isSubtypeWithoutStructuralTyping, isSymbol, isSymbolObjectType, isSymbolValueType, isTemplateType, isTemplatizedType, isTop, isTypeVariable, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isVoidType, meetWith, resolve, restrictByNotNullOrUndefined, toAnnotationString, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toObjectType, toString, typeInference, unboxesToclone, finalize, getClass, notify, notifyAll, wait, wait, waithasProperty, isLegacyNamedTypeautobox, autoboxAndGetObject, containsArray, getEnumeratedTypeOfEnumElement, getGreatestSubtypeWithProperty, getTypeParameters, getUnionMembers, isBooleanValueType, isBottom, isBoxableScalar, isEnumElement, isEnumObject, isEquivalentTo, isFullyInstantiated, isFunctionType, isGenericObjectType, isInstanceofObject, isLiteralObject, isNullType, isNumberValueType, isObjectType, isPartiallyInstantiated, isPrototypeObject, isRecordType, isSomeUnknownType, isStringValueType, isStructuralInterface, isSubtypeOf, isSubtypeWithoutStructuralTyping, isTop, isTypeVariable, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isVoidType, meetWith, restrictByNotNullOrUndefined, toAnnotationString, toMaybeObjectType, typeInferencepublic java.lang.Iterable<ObjectType> getCtorImplementedInterfaces()
ObjectTypegetCtorImplementedInterfaces in class ProxyObjectTypepublic java.lang.Iterable<ObjectType> getCtorExtendedInterfaces()
ObjectTypegetCtorExtendedInterfaces in class ProxyObjectTypepublic int hashCode()
hashCode in class ProxyObjectTypepublic <T> T visit(Visitor<T> visitor)
JSTypevisit in class ProxyObjectTypeVisitorpublic TemplatizedType toMaybeTemplatizedType()
JSTypetoMaybeTemplatizedType in class ProxyObjectTypepublic com.google.common.collect.ImmutableList<JSType> getTemplateTypes()
ObjectTypegetTemplateTypes in interface ObjectTypeIgetTemplateTypes in class ProxyObjectTypeTemplatizedTypepublic JSType getPropertyType(java.lang.String propertyName)
ObjectTypegetPropertyType in interface ObjectTypeIgetPropertyType in class ObjectTypeUnknownType. This method never
returns null.public boolean isSubtype(JSType that)
JSTypethis is a subtype of that.Note this function also returns true if this type structurally matches the protocol define by that type (if that type is an interface function type) Subtyping rules:
(T1, …, Tn) <: U if and only
Tk <: U for all k ∈ 1..n.U <: (T1, …, Tn) if and only
if U <: Tk for some index k.O1 is a subtype
of an object O2 if it has more properties
than O2 and all common properties are
pairwise subtypes.isSubtype in class ProxyObjectTypethis <: thatprotected boolean isSubtype(JSType that, com.google.javascript.rhino.jstype.JSType.ImplCache implicitImplCache, JSType.SubtypingMode subtypingMode)
JSTypeisSubtype in class ProxyObjectTypeimplicitImplCache - a cache that records the checked
or currently checking type pairs, for example, if previous
checking found that constructor C is a subtype of interface I,
then in the cache, table key <I,C> maps to IMPLEMENT status.public TemplateTypeMap getTemplateTypeMap()
JSTypegetTemplateTypeMap in class ProxyObjectTypepublic boolean hasAnyTemplateTypesInternal()
hasAnyTemplateTypesInternal in class ProxyObjectTypepublic ObjectType getReferencedType()
Copyright © 2009-2018 Google. All Rights Reserved.