public class ScopedTypeLookup extends java.lang.Object
Constructor and Description |
---|
ScopedTypeLookup()
Creates a new case-sensitive lookup with no parent.
|
ScopedTypeLookup(boolean isCaseSensitive)
Creates a new lookup with no parent and the given case-sensitivity.
|
ScopedTypeLookup(java.lang.String packageSeparator,
boolean isCaseSensitive)
Creates a new lookup with no parent and the given package separator and
case-sensitivity.
|
Modifier and Type | Method and Description |
---|---|
void |
addAddtitionalParent(ScopedTypeLookup parent)
Adds an additional parent lookup.
|
boolean |
addImportedNamespace(java.lang.String namespace)
Adds an imported namespace to the scoped lookup.
|
boolean |
containsVariable(java.lang.String variableName)
Returns whether this lookup contains information about the given variable.
|
boolean |
containsVariableWithEntity(java.lang.String variableName,
ShallowEntity definitionEntity)
Returns whether this lookup contains information about a variable with the
given variable that was defined in the given entity.
|
ScopedTypeLookup |
createChildScope()
Creates a new lookup, with this lookup as parent.
|
java.util.Set<java.lang.String> |
getAllVariables()
Returns a set of all existing keys.
|
java.util.Set<java.lang.String> |
getImportedNamespaces()
Returns a set of all imported namespaces.
|
java.lang.String |
getPackageSeparator() |
TypedVariable |
getTypeInfo(java.lang.String variableName)
Returns the type information for the given key.
|
boolean |
hasFullyQualifiedTypeName(java.lang.String variableName,
java.lang.String fullyQualifiedTypeName)
Returns whether the given variable has the type with the given full qualified
type name.
|
boolean |
isCaseSensitive() |
boolean |
isShadowingVariable(java.lang.String variableName,
ShallowEntity variableEntity)
Returns whether the variable with the given name is shadowing the variable
that was defined by the given entity.
|
TypedVariable |
putTypeInfo(java.lang.String variableName,
TypedVariable typeInfo)
Associates the given variable with the given type information in this lookup.
|
public ScopedTypeLookup()
public ScopedTypeLookup(boolean isCaseSensitive)
public ScopedTypeLookup(java.lang.String packageSeparator, boolean isCaseSensitive)
public void addAddtitionalParent(ScopedTypeLookup parent)
null
and this
values.java.lang.AssertionError
- in case the parent to be added is already a descendant of the
current lookup, which would cause a circular lookup dependency.public java.lang.String getPackageSeparator()
public boolean isCaseSensitive()
public ScopedTypeLookup createChildScope()
public java.util.Set<java.lang.String> getAllVariables()
public TypedVariable putTypeInfo(java.lang.String variableName, TypedVariable typeInfo)
public TypedVariable getTypeInfo(java.lang.String variableName)
public boolean addImportedNamespace(java.lang.String namespace)
public java.util.Set<java.lang.String> getImportedNamespaces()
public boolean containsVariable(java.lang.String variableName)
public boolean containsVariableWithEntity(java.lang.String variableName, ShallowEntity definitionEntity)
public boolean isShadowingVariable(java.lang.String variableName, ShallowEntity variableEntity)
public boolean hasFullyQualifiedTypeName(java.lang.String variableName, java.lang.String fullyQualifiedTypeName)