public class Scope extends Object
| Constructor and Description |
|---|
Scope(Map<String,Object> data) |
Scope(Scope parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
assign(String prefix,
Object value)
Associate a value with the given key.
|
boolean |
hasSeen(String variable)
Check if the variable has been seen before in this scope
|
boolean |
isGlobalScope()
Check if this scope is "global", i.e.
|
void |
markAsSeen(String variable)
Mark a variable as seen within this scope
|
Object |
resolve(String var)
Retrieve the value of a key from this scope, or the parent scope if it is not present in the current one.
|
void |
unassign(String prefix)
Remove a key/value pair from this scope
|
Scope |
up()
Move up one level to the parent scope
|
public Scope up()
public void assign(String prefix, Object value)
prefix - key to use in the map of values.value - value to associate.public void unassign(String prefix)
prefix - key to remove from the scopepublic Object resolve(String var)
var - key to retrievepublic boolean isGlobalScope()
public boolean hasSeen(String variable)
variable - variable to check the presence ofpublic void markAsSeen(String variable)
variable - variable to mark as seenCopyright © 2017 Grakn Labs Ltd. All rights reserved.