Class Frame
java.lang.Object
org.apache.commons.jexl3.internal.Frame
A call frame, created from a scope, stores the arguments and local variables in a "stack frame" (sic).
- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Frame
Assign values to this frame.(package private) Object
get
(int s) Gets a value.getScope()
Gets the scope.String[]
Gets this script unbound parameters, i.e.(package private) boolean
has
(int s) Whether this frame defines a symbol, ie declared it and assigned it a value.(package private) Object[]
nocycleStack
(Closure closure) Replace any instance of a closure in this stack by its (fuzzy encoded) offset in it.(package private) void
Sets a value.
-
Field Details
-
scope
The scope. -
stack
The actual stack frame. -
curried
private final int curriedNumber of curried parameters.
-
-
Constructor Details
-
Frame
Creates a new frame.- Parameters:
s
- the scoper
- the stack framec
- the number of curried parameters
-
-
Method Details
-
nocycleStack
Replace any instance of a closure in this stack by its (fuzzy encoded) offset in it.This is to avoid the cyclic dependency between the closure and its frame stack that may point back to it that occur with recursive function definitions.
- Parameters:
closure
- the owning closure- Returns:
- the cleaned-up stack or the stack itself (most of the time)
-
getUnboundParameters
Gets this script unbound parameters, i.e. parameters not bound through curry().- Returns:
- the parameter names
-
getScope
Gets the scope.- Returns:
- this frame scope
-
get
Gets a value.- Parameters:
s
- the offset in this frame- Returns:
- the stacked value
-
has
boolean has(int s) Whether this frame defines a symbol, ie declared it and assigned it a value.- Parameters:
s
- the offset in this frame- Returns:
- true if this symbol has been assigned a value, false otherwise
-
set
Sets a value.- Parameters:
r
- the offset in this framevalue
- the value to set in this frame
-
assign
Assign values to this frame.- Parameters:
values
- the values- Returns:
- this frame
-