state
Functions in the state category allow you to do things with side-effects in the function flow. Specifically, they allow you to save or load values of named variables to thread-local registers.
Clear
Clears the per-thread map which is used by the Expr function.
- Object -> Clear() -> Object
- notes: Clear all named entries from the per-thread map.
- ex:
Clear()
- clear all thread-local variables
- Object -> Clear(String… names) -> Object
- notes: Clear the specified names from the per-thread map.
- ex:
Clear('foo')
- clear the thread-local variable ‘foo’ - ex:
Clear('foo','bar')
- clear the thread-local variables ‘foo’ and ‘bar’
- long -> Clear() -> long
- notes: Clear all named entries from the per-thread map.
- ex:
Clear()
- clear all thread-local variables
- long -> Clear(String… names) -> long
- notes: Clear the specified names from the per-thread map.
- ex:
Clear('foo')
- clear the thread-local variable ‘foo’ - ex:
Clear('foo','bar')
- clear the thread-local variables ‘foo’ and ‘bar’
Load
Load a named value from the per-thread state map. The previous input value will be forgotten, and the named value will replace it before the next function in the chain.
- double -> Load(String: name) -> double
- ex:
Load('foo')
- for the current thread, load a double value from the named variable
- ex:
- double -> Load(String: name, double: defaultValue) -> double
- ex:
Load('foo',432.0D)
- for the current thread, load a double value from the named variable, or the defaultvalue if it is not yet defined.
- ex:
- double -> Load(java.util.function.Function
- double -> Load(java.util.function.Function
- long -> Load(String: name) -> long
- ex:
Load('foo')
- for the current thread, load a long value from the named variable
- ex:
- long -> Load(String: name, long: defaultValue) -> long
- ex:
Load('foo', 423L)
- for the current thread, load a long value from the named variable, or the default value if the variable is not yet defined
- ex:
- long -> Load(java.util.function.Function
- long -> Load(java.util.function.Function
- Object -> Load(String: name) -> Object
- ex:
Load('foo')
- for the current thread, load an Object value from the named variable
- ex:
- Object -> Load(java.util.function.Function
- Object -> Load(String: name, Object: defaultValue) -> Object
- ex:
Load('foo','testvalue')
- for the current thread, load an Object value from the named variable, or the default value if the variable is not yet defined.
- ex:
- Object -> Load(java.util.function.Function
- long -> Load(String: name) -> Object
- ex:
Load('foo')
- for the current thread, load an Object value from the named variable
- ex:
- long -> Load(java.util.function.LongFunction
- long -> Load(String: name, Object: defaultValue) -> Object
- ex:
Load('foo','testvalue')
- for the current thread, load an Object value from the named variable, or the default value if the variable is not yet defined.
- ex:
- long -> Load(java.util.function.LongFunction
- int -> Load(String: name) -> int
- ex:
Load('foo')
- for the current thread, load an int value from the named variable
- ex:
- int -> Load(String: name, int: defaultValue) -> int
- ex:
Load('foo',42)
- for the current thread, load an int value from the named variable, or return the default value if it is undefined.
- ex:
- int -> Load(java.util.function.Function
- int -> Load(java.util.function.Function
- String -> Load(String: name) -> String
- ex:
Load('foo')
- for the current thread, load a String value from the named variable
- ex:
- String -> Load(String: name, String: defaultvalue) -> String
- ex:
Load('foo','track05')
- for the current thread, load a String value from the named variable, or teh default value if the variable is not yet defined.
- ex:
- String -> Load(java.util.function.Function
- String -> Load(java.util.function.Function
Save
Save the current input value at this point in the function chain to a thread-local variable name. The input value is unchanged, and available for the next function in the chain to use as-is.
- double -> Save(String: name) -> double
- ex:
Save('foo')
- for the current thread, save the current double value to the named variable.
- ex:
- double -> Save(java.util.function.Function
- long -> Save(String: name) -> long
- ex:
Save('foo')
- save the current long value to the name ‘foo’ in this thread
- ex:
- long -> Save(java.util.function.Function
- Object -> Save(String: name) -> Object
- ex:
Save('foo')
- for the current thread, save the input object value to the named variable
- ex:
- Object -> Save(java.util.function.Function
- long -> Save(String: name) -> long
- ex:
Save('foo')
- for the current thread, save the input object value to the named variable
- ex:
- long -> Save(java.util.function.LongFunction
- int -> Save(String: name) -> int
- ex:
Save('foo')
- save the current int value to the name ‘foo’ in this thread
- ex:
- int -> Save(java.util.function.Function
- String -> Save(String: name) -> String
- ex:
Save('foo')
- save the current String value to the name ‘foo’ in this thread
- ex:
- String -> Save(java.util.function.Function
Show
Show diagnostic values for the thread-local variable map.
- Object -> Show() -> String
- ex:
Show()
- Show all values in a json-like format
- ex:
- Object -> Show(String… names) -> String
- ex:
Show('foo')
- Show only the ‘foo’ value in a json-like format - ex:
Show('foo','bar')
- Show the ‘foo’ and ‘bar’ values in a json-like format
- ex:
- long -> Show() -> String
- ex:
Show()
- Show all values in a json-like format
- ex:
- long -> Show(String… names) -> String
- ex:
Show('foo')
- Show only the ‘foo’ value in a json-like format - ex:
Show('foo','bar')
- Show the ‘foo’ and ‘bar’ values in a json-like format
- ex:
Swap
Load a named value from the per-thread state map. The previous input value will be stored in the named value, and the previously stored value will be returned. A default value to return may be provided in case there was no previously stored value under the given name.
- long -> Swap(String: name) -> long
- ex:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable.
- ex:
- long -> Swap(String: name, long: defaultValue) -> long
- ex:
Swap('foo',234L)
- for the current thread, swap the input value with the named variable and returned the named variable,or the default value if the named variable is not defined.
- ex:
- long -> Swap(java.util.function.LongFunction
: nameFunc) -> long - ex:
Swap(NumberNameToString())
- for the current thread, swap the input value with the named variable and returned the named variable, where the variable name is generated by the provided function.
- ex:
- long -> Swap(java.util.function.LongFunction
: nameFunc, long: defaultValue) -> long - ex:
Swap(NumberNameToString(), 234L)
- for the current thread, swap the input value with the named variable and returned the named variable, where the variable name is generated by the provided function, or the default value if the named variable is not defined.
- ex:
- Object -> Swap(String: name) -> Object
- ex:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable
- ex:
- Object -> Swap(String: name, Object: defaultValue) -> Object
- ex:
Swap('foo','examplevalue')
- for the current thread, swap the input value with the named variable and returned the named variable, or return the default value if the named value is not defined.
- ex:
- Object -> Swap(java.util.function.Function
- Object -> Swap(java.util.function.Function
- long -> Swap(String: name) -> Object
- ex:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable
- ex:
- long -> Swap(String: name, Object: defaultValue) -> Object
- ex:
Swap('foo','examplevalue')
- for the current thread, swap the input value with the named variable and returned the named variable, or return the default value if the named value is not defined.
- ex:
- long -> Swap(java.util.function.LongFunction
- long -> Swap(java.util.function.LongFunction