Class DefaultScopeResolver
java.lang.Object
com.blackrook.rookscript.resolvers.scope.DefaultScopeResolver
- All Implemented Interfaces:
ScriptScopeResolver
An single, scoped open variable set in which values can be set.
All variable names are CASE-INSENSITIVE.
The internals are written so that the storage uses few memory allocations/deletions.
None of the variables are read-only. This implementation is thread-safe.
- Author:
- Matthew Tropiano
-
Field Summary
Fields inherited from interface com.blackrook.rookscript.resolvers.ScriptScopeResolver
EMPTY
-
Constructor Summary
ConstructorDescriptionCreates a new default scope resolver with no added scopes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addScope
(String name, ScriptVariableResolver resolver) Adds a scope to this scope resolver by name.void
clear()
Clears this scope resolver of all added scope mappings.boolean
containsScope
(String name) Checks if this contains a scope by its scope name.Gets the corresponding scope for a scope name.
-
Constructor Details
-
DefaultScopeResolver
public DefaultScopeResolver()Creates a new default scope resolver with no added scopes.
-
-
Method Details
-
addScope
Adds a scope to this scope resolver by name.- Parameters:
name
- the name of the scope.resolver
- the resolver to resolve by that name.
-
clear
public void clear()Clears this scope resolver of all added scope mappings. -
getScope
Description copied from interface:ScriptScopeResolver
Gets the corresponding scope for a scope name.- Specified by:
getScope
in interfaceScriptScopeResolver
- Parameters:
name
- the scope name.- Returns:
- the corresponding scope, or
null
if no corresponding scope.
-
containsScope
Description copied from interface:ScriptScopeResolver
Checks if this contains a scope by its scope name.- Specified by:
containsScope
in interfaceScriptScopeResolver
- Parameters:
name
- the scope name.- Returns:
- true if so, false if not.
-