Class TemplateTypeMap
- java.lang.Object
-
- com.google.javascript.rhino.jstype.TemplateTypeMap
-
- All Implemented Interfaces:
java.io.Serializable
public class TemplateTypeMap extends java.lang.Object implements java.io.SerializableManages a mapping from TemplateType to its resolved JSType. Provides utility methods for cloning/extending the map.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TemplateTypeMapcopyWithExtension(com.google.common.collect.ImmutableList<TemplateType> keys, com.google.common.collect.ImmutableList<JSType> values)Create a new map in which the keys and values have been extended bykeysandvaluesrespectively.TemplateTypeMapcopyWithExtension(TemplateTypeMap extension)Create a new map in which the keys and values have been extended byextension.JSTypegetResolvedTemplateType(TemplateType key)Returns the JSType value associated with the specified template key.com.google.common.collect.ImmutableList<TemplateType>getTemplateKeys()Returns a list of all template keys.TemplateTypegetTemplateTypeKeyByName(java.lang.String keyName)com.google.common.collect.ImmutableList<JSType>getTemplateValues()booleanhasTemplateKey(TemplateType templateKey)Returns true if this map contains the specified template key, false otherwise.booleanhasTemplateType(TemplateType key)Returns true if there is a JSType value associated with the specified template key; false otherwise.booleanisEmpty()Returns true if the map is empty; false otherwise.intsize()java.lang.StringtoString()
-
-
-
Method Detail
-
copyWithExtension
public TemplateTypeMap copyWithExtension(TemplateTypeMap extension)
Create a new map in which the keys and values have been extended byextension.Before extension, any unfilled values in the initial map will be filled with `?`.
-
copyWithExtension
public TemplateTypeMap copyWithExtension(com.google.common.collect.ImmutableList<TemplateType> keys, com.google.common.collect.ImmutableList<JSType> values)
Create a new map in which the keys and values have been extended bykeysandvaluesrespectively.Before extension, any unfilled values in the initial map will be filled with `?`.
-
size
public int size()
-
isEmpty
public boolean isEmpty()
Returns true if the map is empty; false otherwise.
-
getTemplateKeys
public com.google.common.collect.ImmutableList<TemplateType> getTemplateKeys()
Returns a list of all template keys.
-
getTemplateValues
public com.google.common.collect.ImmutableList<JSType> getTemplateValues()
-
hasTemplateKey
public boolean hasTemplateKey(TemplateType templateKey)
Returns true if this map contains the specified template key, false otherwise.
-
hasTemplateType
public boolean hasTemplateType(TemplateType key)
Returns true if there is a JSType value associated with the specified template key; false otherwise.
-
getTemplateTypeKeyByName
public TemplateType getTemplateTypeKeyByName(java.lang.String keyName)
-
getResolvedTemplateType
public JSType getResolvedTemplateType(TemplateType key)
Returns the JSType value associated with the specified template key. If no JSType value is associated, returns the upper bound for generic, UNKNOWN_TYPE if unspecified.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-