Class ScopedObjects
java.lang.Object
com.aquima.interactions.expressions.semantics.ScopedObjects
This class is used to gather the objects that need to be in-scope in order to be able to evaluate the expression.
- Since:
- 6.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionScopedObjects
(ITypeEnvironment definitions) Constructs the scoped objects class with the definitions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method will register an object access.String[]
This method returns an array containing all the objects that were accessed.void
This method will de-register the last added variable.void
pushVariable
(String variableName) This method will register a local variable.
-
Constructor Details
-
ScopedObjects
Constructs the scoped objects class with the definitions. The definitions are used to determine if a local variable is of the same type as an object that is requested in the scope.- Parameters:
definitions
- Object containing the definitions of the objects that may be used in an expression.
-
-
Method Details
-
add
This method will register an object access.- Parameters:
scopeObject
- The object that is accessed.allAccess
- Boolean indicating if all objects of this type are requested or just a singleton.
-
pushVariable
This method will register a local variable.- Parameters:
variableName
- The name of the local variable.
-
popVariable
public void popVariable()This method will de-register the last added variable. -
getScopedObject
This method returns an array containing all the objects that were accessed.- Returns:
- an array containing all the objects that were accessed.
-