public class TemplateTypeMap
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
private static class |
TemplateTypeMap.EquivalenceMatch
An enum tracking the three different equivalence match states for a
template key-value pair.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
inRecursiveEquivalenceCheck |
(package private) JSTypeRegistry |
registry |
private com.google.common.collect.ImmutableList<JSType> |
resolvedTemplateValues |
private com.google.common.collect.ImmutableList<TemplateType> |
templateKeys |
private com.google.common.collect.ImmutableList<JSType> |
templateValues |
Constructor and Description |
---|
TemplateTypeMap(JSTypeRegistry registry,
com.google.common.collect.ImmutableList<TemplateType> templateKeys,
com.google.common.collect.ImmutableList<JSType> templateValues) |
Modifier and Type | Method and Description |
---|---|
private TemplateTypeMap |
addUnknownValues()
Returns a new TemplateTypeMap, where all unfilled values have been filled
with UNKNOWN_TYPE.
|
(package private) TemplateTypeMap |
addValues(com.google.common.collect.ImmutableList<JSType> newValues)
Returns a new TemplateTypeMap whose values have been extended with the
specified list.
|
private static boolean |
checkEquivalenceHelper(EquivalenceMethod eqMethod,
TemplateTypeMap thisMap,
TemplateTypeMap thatMap,
JSType.EqCache eqCache) |
boolean |
checkEquivalenceHelper(TemplateTypeMap that,
EquivalenceMethod eqMethod)
Determines if this map and the specified map have equivalent template
types.
|
boolean |
checkEquivalenceHelper(TemplateTypeMap that,
EquivalenceMethod eqMethod,
JSType.EqCache eqCache) |
private <T> com.google.common.collect.ImmutableList<T> |
concatImmutableLists(com.google.common.collect.ImmutableList<T> first,
com.google.common.collect.ImmutableList<T> second)
Concatenates two ImmutableList instances.
|
(package private) TemplateTypeMap |
extend(TemplateTypeMap thatMap)
Extends this TemplateTypeMap with the contents of the specified map.
|
private static boolean |
failedEquivalenceCheck(TemplateTypeMap.EquivalenceMatch eqMatch,
EquivalenceMethod eqMethod)
Determines if the specified EquivalenceMatch is considered a failing
condition for an equivalence check, given the EquivalenceMethod used for
the check.
|
JSType |
getResolvedTemplateType(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.
|
private int |
getTemplateTypeIndex(TemplateType key)
Returns the index of the JSType value associated with the specified
template key.
|
TemplateType |
getTemplateTypeKeyByName(java.lang.String keyName) |
(package private) com.google.common.collect.ImmutableList<TemplateType> |
getUnfilledTemplateKeys()
Returns a list of template keys in this map that do not have corresponding
JSType values.
|
(package private) JSType |
getUnresolvedOriginalTemplateType(TemplateType key) |
(package private) boolean |
hasAnyTemplateTypesInternal() |
boolean |
hasTemplateKey(TemplateType templateKey)
Returns true if this map contains the specified template key, false
otherwise.
|
boolean |
hasTemplateType(TemplateType key)
Returns true if there is a JSType value associated with the specified
template key; false otherwise.
|
boolean |
isEmpty()
Returns true if the map is empty; false otherwise.
|
(package private) int |
numUnfilledTemplateKeys()
Returns the number of template keys in this map that do not have a
corresponding JSType value.
|
java.lang.String |
toString() |
private final com.google.common.collect.ImmutableList<TemplateType> templateKeys
private final com.google.common.collect.ImmutableList<JSType> templateValues
private final com.google.common.collect.ImmutableList<JSType> resolvedTemplateValues
private boolean inRecursiveEquivalenceCheck
final JSTypeRegistry registry
TemplateTypeMap(JSTypeRegistry registry, com.google.common.collect.ImmutableList<TemplateType> templateKeys, com.google.common.collect.ImmutableList<JSType> templateValues)
public boolean isEmpty()
public com.google.common.collect.ImmutableList<TemplateType> getTemplateKeys()
public boolean hasTemplateKey(TemplateType templateKey)
int numUnfilledTemplateKeys()
com.google.common.collect.ImmutableList<TemplateType> getUnfilledTemplateKeys()
public boolean hasTemplateType(TemplateType key)
JSType getUnresolvedOriginalTemplateType(TemplateType key)
public TemplateType getTemplateTypeKeyByName(java.lang.String keyName)
private int getTemplateTypeIndex(TemplateType key)
public JSType getResolvedTemplateType(TemplateType key)
public boolean checkEquivalenceHelper(TemplateTypeMap that, EquivalenceMethod eqMethod)
public boolean checkEquivalenceHelper(TemplateTypeMap that, EquivalenceMethod eqMethod, JSType.EqCache eqCache)
private static boolean checkEquivalenceHelper(EquivalenceMethod eqMethod, TemplateTypeMap thisMap, TemplateTypeMap thatMap, JSType.EqCache eqCache)
private static boolean failedEquivalenceCheck(TemplateTypeMap.EquivalenceMatch eqMatch, EquivalenceMethod eqMethod)
TemplateTypeMap extend(TemplateTypeMap thatMap)
TemplateTypeMap addValues(com.google.common.collect.ImmutableList<JSType> newValues)
private TemplateTypeMap addUnknownValues()
private <T> com.google.common.collect.ImmutableList<T> concatImmutableLists(com.google.common.collect.ImmutableList<T> first, com.google.common.collect.ImmutableList<T> second)
boolean hasAnyTemplateTypesInternal()
public java.lang.String toString()
toString
in class java.lang.Object