public final class EnumType extends Namespace
commonTypes, defSite, name, namespaceType, otherProps| Modifier and Type | Method and Description |
|---|---|
protected JSType |
computeJSType()
When defining an enum such as
/** @enum {number} * /
var X = { ONE: 1, TWO: 2 };
the properties of the object literal are constant.
|
boolean |
enumLiteralHasKey(String name) |
JSType |
getDeclaredProp(QualifiedName qname)
Get the declared type of the given property, or null if the named
property is not declared.
|
JSType |
getEnumeratedType() |
JSType |
getProp(QualifiedName qname)
Get the inferred type of the given property.
|
JSType |
getPropType() |
Collection<JSType> |
getSubtypesWithProperty(QualifiedName qname)
Return all topmost subtypes of this type that have the given property.
|
JSTypeExpression |
getTypeExpr() |
JSTypeExpression |
getTypeExprForErrorReporting() |
boolean |
hasConstantProp(QualifiedName qname)
Return true if this type contains the given property and it is constant.
|
boolean |
hasProp(QualifiedName qname)
Return true if this type contains the given required property.
|
boolean |
isResolved() |
static EnumType |
make(JSTypes commonTypes,
String name,
Node defSite,
JSTypeExpression typeExpr,
Collection<String> props) |
boolean |
mayHaveProp(QualifiedName qname)
Return true if this type contains any form of the given property
(this may include declared, inferred, required, or optional properties).
|
addNamespace, addProperty, addTypedef, addUndeclaredProperty, copyWindowProperties, getDeclaration, getDefSite, getName, getPropDeclaredType, getSubnamespace, hasProp, hasSubnamespace, isDefined, toJSType, toStringpublic static EnumType make(JSTypes commonTypes, String name, Node defSite, JSTypeExpression typeExpr, Collection<String> props)
public boolean isResolved()
public JSType getEnumeratedType()
public JSType getPropType()
public JSTypeExpression getTypeExpr()
public JSTypeExpression getTypeExprForErrorReporting()
protected JSType computeJSType()
computeJSType in class Namespacepublic JSType getProp(QualifiedName qname)
public JSType getDeclaredProp(QualifiedName qname)
public boolean mayHaveProp(QualifiedName qname)
public boolean hasProp(QualifiedName qname)
public boolean hasConstantProp(QualifiedName qname)
public boolean enumLiteralHasKey(String name)
public Collection<JSType> getSubtypesWithProperty(QualifiedName qname)
Copyright © 2009-2017 Google. All Rights Reserved.