Class Resolver.Level<V extends IResolvable>
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Resolver.Level<V>
-
- Type Parameters:
V- the type of variable declarations
- Enclosing class:
- Resolver<V extends IResolvable>
private static class Resolver.Level<V extends IResolvable> extends java.lang.ObjectRepresents a (nested) resolution level.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private Resolver.IContextTypecontextprivate booleanlimitprivate java.util.Map<java.lang.String,V>variables
-
Constructor Summary
Constructors Constructor Description Level(Resolver.IContextType context)Creates a new level with a given context type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.String name)Returns whether this level contains a variable with the givenname.Vget(java.lang.String name)Returns the variable for a given name.Resolver.IContextTypegetContextType()Returns the current context.booleanisLimited()Returns whether this scope is limited.voidlimitVariables()Indicates that subsequent resolutions within that scope shall not exceed this scope.voidput(java.lang.String name, V var)Puts a variable.voidremove(java.lang.String name)Removes a variable.voidsetContextType(Resolver.IContextType context)Defines the current context.
-
-
-
Field Detail
-
variables
private java.util.Map<java.lang.String,V extends IResolvable> variables
-
context
private Resolver.IContextType context
-
limit
private boolean limit
-
-
Constructor Detail
-
Level
public Level(Resolver.IContextType context)
Creates a new level with a given context type.- Parameters:
context- the context type
-
-
Method Detail
-
put
public void put(java.lang.String name, V var)Puts a variable.- Parameters:
name- the name of the variablevar- the variable (resolvable)
-
remove
public void remove(java.lang.String name)
Removes a variable.- Parameters:
name- the name of the variable
-
contains
public boolean contains(java.lang.String name)
Returns whether this level contains a variable with the givenname.- Parameters:
name- the name to search for- Returns:
trueif the variable is registered,falseelse
-
get
public V get(java.lang.String name)
Returns the variable for a given name.- Parameters:
name- the name to return the variable for- Returns:
- the variable (may be null)
-
setContextType
public void setContextType(Resolver.IContextType context)
Defines the current context.- Parameters:
context- the current context
-
getContextType
public Resolver.IContextType getContextType()
Returns the current context.- Returns:
- the current context
-
limitVariables
public void limitVariables()
Indicates that subsequent resolutions within that scope shall not exceed this scope.
-
isLimited
public boolean isLimited()
Returns whether this scope is limited.- Returns:
trueif limited,falseelse- See Also:
limitVariables()
-
-