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
ConstructorsConstructorDescriptionCreates a new default scope resolver with no added scopes. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScope(String name, ScriptVariableResolver resolver) Adds a scope to this scope resolver by name.voidclear()Clears this scope resolver of all added scope mappings.booleancontainsScope(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:ScriptScopeResolverGets the corresponding scope for a scope name.- Specified by:
getScopein interfaceScriptScopeResolver- Parameters:
name- the scope name.- Returns:
- the corresponding scope, or
nullif no corresponding scope.
-
containsScope
Description copied from interface:ScriptScopeResolverChecks if this contains a scope by its scope name.- Specified by:
containsScopein interfaceScriptScopeResolver- Parameters:
name- the scope name.- Returns:
- true if so, false if not.
-