public abstract class JSType extends Object
Modifier and Type | Field and Description |
---|---|
static JSType |
BOOLEAN |
protected static int |
BOOLEAN_MASK |
static JSType |
BOTTOM |
protected static int |
BOTTOM_MASK |
protected static int |
END_MASK |
protected static int |
ENUM_MASK |
protected static int |
FALSE_MASK |
static JSType |
FALSE_TYPE |
static JSType |
FALSY |
protected static int |
FALSY_MASK |
static boolean |
mockToString |
protected static int |
NON_SCALAR_MASK |
static JSType |
NULL |
protected static int |
NULL_MASK |
static JSType |
NULL_OR_UNDEF |
static JSType |
NUM_OR_STR |
static JSType |
NUMBER |
protected static int |
NUMBER_MASK |
static JSType |
STRING |
protected static int |
STRING_MASK |
static JSType |
TOP |
static JSType |
TOP_DICT |
protected static int |
TOP_MASK |
static JSType |
TOP_OBJECT |
static JSType |
TOP_SCALAR |
protected static int |
TOP_SCALAR_MASK |
static JSType |
TOP_STRUCT |
protected static int |
TRUE_MASK |
static JSType |
TRUE_TYPE |
static JSType |
TRUTHY |
protected static int |
TRUTHY_MASK |
protected static int |
TYPEVAR_MASK |
static JSType |
UNDEFINED |
protected static int |
UNDEFINED_MASK |
static JSType |
UNKNOWN |
protected static int |
UNKNOWN_MASK |
Constructor and Description |
---|
JSType() |
Modifier and Type | Method and Description |
---|---|
StringBuilder |
appendTo(StringBuilder builder) |
static boolean |
areCompatibleScalarTypes(JSType lhs,
JSType rhs) |
JSType |
autobox(JSTypes commonTypes) |
boolean |
equals(Object o) |
static JSType |
fromObjectType(ObjectType obj) |
static JSType |
fromTypeVar(String template) |
JSType |
getDeclaredProp(QualifiedName qname) |
JSType |
getEnumeratedType() |
protected abstract com.google.common.collect.ImmutableSet<EnumType> |
getEnums() |
FunctionType |
getFunType() |
FunctionType |
getFunTypeIfSingletonObj() |
protected abstract int |
getMask() |
JSType |
getProp(QualifiedName qname) |
protected abstract String |
getTypeVar() |
boolean |
hasConstantProp(QualifiedName pname) |
int |
hashCode() |
boolean |
hasNonScalar() |
boolean |
hasProp(QualifiedName qname) |
boolean |
isBoolean() |
boolean |
isBottom() |
boolean |
isDict() |
boolean |
isEnumElement() |
boolean |
isFalsy() |
boolean |
isInterfaceDefinition() |
boolean |
isLoose() |
boolean |
isLooseStruct() |
boolean |
isNonLooseSubtypeOf(JSType other) |
boolean |
isNullable() |
boolean |
isNullOrUndef() |
boolean |
isScalar() |
boolean |
isStruct() |
boolean |
isSubtypeOf(JSType other) |
boolean |
isTop() |
boolean |
isTruthy() |
boolean |
isUnion() |
boolean |
isUnknown() |
static JSType |
join(JSType lhs,
JSType rhs) |
boolean |
mayHaveProp(QualifiedName qname) |
static JSType |
meet(JSType lhs,
JSType rhs) |
JSType |
negate() |
static JSType |
plus(JSType lhs,
JSType rhs) |
JSType |
removeType(JSType other) |
JSType |
specialize(JSType other) |
JSType |
substituteGenerics(Map<String,JSType> concreteTypes) |
JSType |
toBoolean() |
String |
toString() |
boolean |
unifyWith(JSType other,
List<String> typeParameters,
com.google.common.collect.Multimap<String,JSType> typeMultimap)
Unify
this , which may contain free type variables,
with other , a concrete type, modifying the supplied
typeMultimap to add any new template variable type bindings. |
JSType |
withDeclaredProperty(QualifiedName qname,
JSType type,
boolean isConstant) |
JSType |
withLoose()
Turns the class-less object of this type (if any) into a loose object
|
JSType |
withoutProperty(QualifiedName qname) |
JSType |
withProperty(QualifiedName qname,
JSType type) |
JSType |
withPropertyRequired(String pname) |
protected static final int BOTTOM_MASK
protected static final int TYPEVAR_MASK
protected static final int NON_SCALAR_MASK
protected static final int ENUM_MASK
protected static final int TRUE_MASK
protected static final int FALSE_MASK
protected static final int NULL_MASK
protected static final int NUMBER_MASK
protected static final int STRING_MASK
protected static final int UNDEFINED_MASK
protected static final int END_MASK
protected static final int TRUTHY_MASK
protected static final int FALSY_MASK
protected static final int UNKNOWN_MASK
protected static final int TOP_MASK
protected static final int BOOLEAN_MASK
protected static final int TOP_SCALAR_MASK
public static boolean mockToString
public static final JSType BOOLEAN
public static final JSType BOTTOM
public static final JSType FALSE_TYPE
public static final JSType FALSY
public static final JSType NULL
public static final JSType NUMBER
public static final JSType STRING
public static final JSType TOP
public static final JSType TOP_SCALAR
public static final JSType TRUE_TYPE
public static final JSType TRUTHY
public static final JSType UNDEFINED
public static final JSType UNKNOWN
public static final JSType TOP_OBJECT
public static final JSType TOP_STRUCT
public static final JSType TOP_DICT
public static final JSType NULL_OR_UNDEF
public static final JSType NUM_OR_STR
protected abstract int getMask()
protected abstract String getTypeVar()
protected abstract com.google.common.collect.ImmutableSet<EnumType> getEnums()
public static JSType fromObjectType(ObjectType obj)
public boolean isTop()
public boolean isBottom()
public boolean isUnknown()
public boolean isTruthy()
public boolean isFalsy()
public boolean isBoolean()
public boolean isNullOrUndef()
public boolean isScalar()
public boolean hasNonScalar()
public boolean isNullable()
public boolean isStruct()
public boolean isLooseStruct()
public boolean isLoose()
public boolean isDict()
public boolean isEnumElement()
public boolean isUnion()
public JSType getEnumeratedType()
public boolean unifyWith(JSType other, List<String> typeParameters, com.google.common.collect.Multimap<String,JSType> typeMultimap)
this
, which may contain free type variables,
with other
, a concrete type, modifying the supplied
typeMultimap
to add any new template variable type bindings.public JSType negate()
public JSType toBoolean()
public boolean isNonLooseSubtypeOf(JSType other)
public boolean isSubtypeOf(JSType other)
public FunctionType getFunTypeIfSingletonObj()
public FunctionType getFunType()
public boolean isInterfaceDefinition()
public JSType withLoose()
public JSType getProp(QualifiedName qname)
public JSType getDeclaredProp(QualifiedName qname)
public boolean mayHaveProp(QualifiedName qname)
public boolean hasProp(QualifiedName qname)
public boolean hasConstantProp(QualifiedName pname)
public JSType withoutProperty(QualifiedName qname)
public JSType withProperty(QualifiedName qname, JSType type)
public JSType withDeclaredProperty(QualifiedName qname, JSType type, boolean isConstant)
public StringBuilder appendTo(StringBuilder builder)
Copyright © 2009–2017 Google. All rights reserved.