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. These work best when used with non-async activities, since the normal statement grouping allows you to share data between statements in the sequence. It is not advised to use these with async activities.
When using these functions, be careful that you call them when needed. For example, if you have a named binding which will save a value, that action only occurs if some statement with this named binding is used.
For example, if you have an account records and transaction records, where you want to save the account identifier to use within the transaction inserts, you must ensure that each account binding is used within the thread first.
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.
-
example:
Clear()
-
clear all thread-local variables
-
-
Object -> Clear(String[]...: names) -> Object
-
notes: Clear the specified names from the per-thread map. @param names The names to be removed from the map.
-
example:
Clear('foo')
-
clear the thread-local variable 'foo'
-
example:
Clear('foo','bar')
-
clear the thread-local variables 'foo' and 'bar'
-
-
long -> Clear() -> long
-
notes: Clear all named entries from the per-thread map.
-
example:
Clear()
-
clear all thread-local variables
-
-
long -> Clear(String[]...: names) -> long
-
notes: Clear the specified names from the per-thread map. @param names The names to be removed from the map.
-
example:
Clear('foo')
-
clear the thread-local variable 'foo'
-
example:
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.
-
String -> Load(String: name) -> String
- example:
Load('foo')
- for the current thread, load a String value from the named variable
- example:
-
String -> Load(String: name, String: defaultvalue) -> String
- example:
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.
- example:
-
String -> Load(function.Function<Object,Object>: nameFunc) -> String
- example:
Load(NumberNameToString())
- for the current thread, load a String value from the named variable, where the variable name is provided by a function
- example:
-
String -> Load(function.Function<Object,Object>: nameFunc, String: defaultValue) -> String
- example:
Load(NumberNameToString(),'track05')
- for the current thread, load a String value from the named variable, where the variable name is provided by a function, or the default value if the variable is not yet defined.
- example:
-
int -> Load(String: name) -> int
- example:
Load('foo')
- for the current thread, load an int value from the named variable
- example:
-
int -> Load(String: name, int: defaultValue) -> int
- example:
Load('foo',42)
- for the current thread, load an int value from the named variable, or return the default value if it is undefined.
- example:
-
int -> Load(function.Function<Object,Object>: nameFunc) -> int
- example:
Load(NumberNameToString())
- for the current thread, load an int value from the named variable, where the variable name is provided by a function.
- example:
-
int -> Load(function.Function<Object,Object>: nameFunc, int: defaultValue) -> int
- example:
Load(NumberNameToString(),42)
- for the current thread, load an int value from the named variable, where the variable name is provided by a function, or the default value if the named variable is undefined.
- example:
-
double -> Load(String: name) -> double
- example:
Load('foo')
- for the current thread, load a double value from the named variable
- example:
-
double -> Load(String: name, double: defaultValue) -> double
- example:
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.
- example:
-
double -> Load(function.Function<Object,Object>: nameFunc) -> double
- example:
Load(NumberNameToString())
- for the current thread, load a double value from the named variable, where the variablename is provided by a function.
- example:
-
double -> Load(function.Function<Object,Object>: nameFunc, double: defaultValue) -> double
- example:
Load(NumberNameToString(),1234.5D)
- for the current thread, load a double value from the named variable, where the variablename is provided by a function, or the default value if the named value is not yet defined.
- example:
-
long -> Load(String: name) -> long
- example:
Load('foo')
- for the current thread, load a long value from the named variable
- example:
-
long -> Load(String: name, long: defaultValue) -> long
- example:
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
- example:
-
long -> Load(function.Function<Object,Object>: nameFunc) -> long
- example:
Load(NumberNameToString())
- for the current thread, load a long value from the named variable, where the variable name is provided by the provided by a function.
- example:
-
long -> Load(function.Function<Object,Object>: nameFunc, long: defaultvalue) -> long
- example:
Load(NumberNameToString(),22L)
- for the current thread, load a long value from the named variable, where the variable name is provided by the provided by a function, or the default value if the variable is not yet defined
- example:
-
long -> Load(String: name) -> Object
- example:
Load('foo')
- for the current thread, load an Object value from the named variable
- example:
-
long -> Load(function.LongFunction<Object>: nameFunc) -> Object
- example:
Load(NumberNameToString())
- for the current thread, load an Object value from the named variable, where the variable name is returned by the provided function
- example:
-
long -> Load(String: name, Object: defaultValue) -> Object
- example:
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.
- example:
-
long -> Load(function.LongFunction<Object>: nameFunc, Object: defaultValue) -> Object
- example:
Load(NumberNameToString(),'testvalue')
- for the current thread, load an Object value from the named variable, where the variable name is returned by the provided function, or thedefault value if the variable is not yet defined.
- example:
-
Object -> Load(String: name) -> Object
- example:
Load('foo')
- for the current thread, load an Object value from the named variable
- example:
-
Object -> Load(function.Function<Object,Object>: nameFunc) -> Object
- example:
Load(NumberNameToString())
- for the current thread, load an Object value from the named variable, where the variable name is returned by the provided function
- example:
-
Object -> Load(String: name, Object: defaultValue) -> Object
- example:
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.
- example:
-
Object -> Load(function.Function<Object,Object>: nameFunc, Object: defaultValue) -> Object
- example:
Load(NumberNameToString(),'testvalue')
- for the current thread, load an Object value from the named variable, where the variable name is returned by the provided function, or thedefault value if the variable is not yet defined.
- example:
LoadCqlVector
-
Object -> LoadCqlVector(String: name) -> com.datastax.oss.driver.api.core.data.CqlVector
- example:
LoadDouble('foo')
- for the current thread, load a double value from the named variable.
- example:
-
Object -> LoadCqlVector(String: name, int: len) -> com.datastax.oss.driver.api.core.data.CqlVector
- example:
LoadDouble('foo',23D)
- for the current thread, load a double value from the named variable,or the default value if the named variable is not defined.
- example:
LoadCqlVectorFromArray
long -> LoadCqlVectorFromArray(String: name, int: len, int: batchsize) -> com.datastax.oss.driver.api.core.data.CqlVector
LoadDouble
Load a value from a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. If the named variable is not defined, then the default value is returned.
-
long -> LoadDouble(String: name) -> double
- example:
LoadDouble('foo')
- for the current thread, load a double value from the named variable.
- example:
-
long -> LoadDouble(String: name, double: defaultValue) -> double
- example:
LoadDouble('foo',23D)
- for the current thread, load a double value from the named variable,or the default value if the named variable is not defined.
- example:
-
long -> LoadDouble(function.LongFunction<Object>: nameFunc) -> double
- example:
LoadDouble(NumberNameToString())
- for the current thread, load a double value from the named variable, where the variable name is provided by a function.
- example:
-
long -> LoadDouble(function.LongFunction<Object>: nameFunc, double: defaultValue) -> double
- example:
LoadDouble(NumberNameToString(),23D)
- for the current thread, load a double value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
-
Object -> LoadDouble(String: name) -> Double
- example:
LoadDouble('foo')
- for the current thread, load a double value from the named variable.
- example:
-
Object -> LoadDouble(String: name, double: defaultValue) -> Double
- example:
LoadDouble('foo',23D)
- for the current thread, load a double value from the named variable,or the default value if the named variable is not defined.
- example:
-
Object -> LoadDouble(function.Function<Object,Object>: nameFunc) -> Double
- example:
LoadDouble(NumberNameToString())
- for the current thread, load a double value from the named variable, where the variable name is provided by a function.
- example:
-
Object -> LoadDouble(function.Function<Object,Object>: nameFunc, double: defaultValue) -> Double
- example:
LoadDouble(NumberNameToString(),23D)
- for the current thread, load a double value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
LoadFloat
Load a value from a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. If the named variable is not defined, then the default value is returned.
-
Object -> LoadFloat(String: name) -> Float
- example:
LoadFloat('foo')
- for the current thread, load a float value from the named variable.
- example:
-
Object -> LoadFloat(String: name, float: defaultValue) -> Float
- example:
LoadFloat('foo',23F)
- for the current thread, load a float value from the named variable,or the default value if the named variable is not defined.
- example:
-
Object -> LoadFloat(function.Function<Object,Object>: nameFunc) -> Float
- example:
LoadFloat(NumberNameToString())
- for the current thread, load a float value from the named variable,where the variable name is provided by a function.
- example:
-
Object -> LoadFloat(function.Function<Object,Object>: nameFunc, float: defaultValue) -> Float
- example:
LoadFloat(NumberNameToString(),23F)
- for the current thread, load a float value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
-
long -> LoadFloat(String: name) -> Float
- example:
LoadFloat('foo')
- for the current thread, load a float value from the named variable.
- example:
-
long -> LoadFloat(String: name, float: defaultValue) -> Float
- example:
LoadFloat('foo',23F)
- for the current thread, load a float value from the named variable,or the default value if the named variable is not defined.
- example:
-
long -> LoadFloat(function.LongFunction<Object>: nameFunc) -> Float
- example:
LoadFloat(NumberNameToString())
- for the current thread, load a float value from the named variable,where the variable name is provided by a function.
- example:
-
long -> LoadFloat(function.LongFunction<Object>: nameFunc, float: defaultValue) -> Float
- example:
LoadFloat(NumberNameToString(),23F)
- for the current thread, load a float value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
LoadInteger
Load a value from a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. If the named variable is not defined, then the default value is returned.
-
Object -> LoadInteger(String: name) -> Integer
- example:
LoadInteger('foo')
- for the current thread, load an integer value from the named variable.
- example:
-
Object -> LoadInteger(String: name, int: defaultValue) -> Integer
- example:
LoadInteger('foo',42)
- for the current thread, load an integer value from the named variable, or the default value if the named variable is not defined.
- example:
-
Object -> LoadInteger(function.Function<Object,Object>: nameFunc) -> Integer
- example:
LoadInteger(NumberNameToString())
- for the current thread, load an integer value from the named variable,where the variable name is provided by a function.
- example:
-
Object -> LoadInteger(function.Function<Object,Object>: nameFunc, int: defaultValue) -> Integer
- example:
LoadInteger(NumberNameToString(),42)
- for the current thread, load an integer value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
-
long -> LoadInteger(String: name) -> int
- example:
LoadInteger('foo')
- for the current thread, load an integer value from the named variable.
- example:
-
long -> LoadInteger(String: name, int: defaultValue) -> int
- example:
LoadInteger('foo',42)
- for the current thread, load an integer value from the named variable, or the default value if the named variable is not defined.
- example:
-
long -> LoadInteger(function.LongFunction<Object>: nameFunc) -> int
- example:
LoadInteger(NumberNameToString())
- for the current thread, load an integer value from the named variable,where the variable name is provided by a function.
- example:
-
long -> LoadInteger(function.LongFunction<Object>: nameFunc, int: defaultValue) -> int
- example:
LoadInteger(NumberNameToString(),42)
- for the current thread, load an integer value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
LoadLong
Load a value from a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. If the named variable is not defined, then the default value is returned.
-
long -> LoadLong(String: name) -> long
- example:
LoadLong('foo',42L)
- for the current thread, load a long value from the named variable.
- example:
-
long -> LoadLong(String: name, long: defaultValue) -> long
- example:
LoadLong('foo',42L)
- for the current thread, load a long value from the named variable, or the default value if the named variable is not defined.
- example:
-
long -> LoadLong(function.LongFunction<Object>: nameFunc) -> long
- example:
LoadLong(NumberNameToString(),42L)
- for the current thread, load a long value from the named variable,where the variable name is provided by a function.
- example:
-
long -> LoadLong(function.LongFunction<Object>: nameFunc, long: defaultValue) -> long
- example:
LoadLong(NumberNameToString(),42L)
- for the current thread, load a long value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
-
Object -> LoadLong(String: name) -> Long
- example:
LoadLong('foo',42L)
- for the current thread, load a long value from the named variable.
- example:
-
Object -> LoadLong(String: name, long: defaultValue) -> Long
- example:
LoadLong('foo',42L)
- for the current thread, load a long value from the named variable, or the default value if the named variable is not defined.
- example:
-
Object -> LoadLong(function.Function<Object,Object>: nameFunc) -> Long
- example:
LoadLong(NumberNameToString(),42L)
- for the current thread, load a long value from the named variable,where the variable name is provided by a function.
- example:
-
Object -> LoadLong(function.Function<Object,Object>: nameFunc, long: defaultValue) -> Long
- example:
LoadLong(NumberNameToString(),42L)
- for the current thread, load a long value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
LoadString
Load a value from a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. If the named variable is not defined, then the default value is returned.
-
Object -> LoadString(String: name) -> String
- example:
LoadString('foo','examplevalue')
- for the current thread, load a String value from the named variable.
- example:
-
Object -> LoadString(String: name, String: defaultValue) -> String
- example:
LoadString('foo','examplevalue')
- for the current thread, load a String value from the named variable, or the default value if the named variable is not defined.
- example:
-
Object -> LoadString(function.Function<Object,Object>: nameFunc) -> String
- example:
LoadString(NumberNameToString(),'examplevalue')
- for the current thread, load a String value from the named variable, or the default value if the named variable is not defined.
- example:
-
Object -> LoadString(function.Function<Object,Object>: nameFunc, String: defaultValue) -> String
- example:
LoadString(NumberNameToString(),'examplevalue')
- for the current thread, load a String value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
-
long -> LoadString(String: name) -> String
- example:
LoadString('foo','examplevalue')
- for the current thread, load a String value from the named variable.
- example:
-
long -> LoadString(String: name, String: defaultValue) -> String
- example:
LoadString('foo','examplevalue')
- for the current thread, load a String value from the named variable, or the default value if the named variable is not defined.
- example:
-
long -> LoadString(function.LongFunction<Object>: nameFunc) -> String
- example:
LoadString(NumberNameToString(),'examplevalue')
- for the current thread, load a String value from the named variable, or the default value if the named variable is not defined.
- example:
-
long -> LoadString(function.LongFunction<Object>: nameFunc, String: defaultValue) -> String
- example:
LoadString(NumberNameToString(),'examplevalue')
- for the current thread, load a String value from the named variable,where the variable name is provided by a function, or the default value if the namedvariable is not defined.
- example:
NullOrLoad
Reads a long variable from the input, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return null object or a loaded value.
long -> NullOrLoad(double: ratio, String: varname) -> Object
NullOrPass
Reads a long variable from the thread local variable map, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return a null object or the input value.
Object -> NullOrPass(double: ratio, String: varname) -> Object
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.
-
long -> Save(String: name) -> long
- example:
Save('foo')
- for the current thread, save the input object value to the named variable
- example:
-
long -> Save(function.LongFunction<Object>: nameFunc) -> long
- example:
Save(NumberNameToString())
- for the current thread, save the current input object value to the named variable,where the variable name is provided by a function.
- example:
-
long -> Save(String: name) -> long
- example:
Save('foo')
- save the current long value to the name 'foo' in this thread
- example:
-
long -> Save(function.Function<Object,Object>: nameFunc) -> long
- example:
Save(NumberNameToString())
- save the current long value to the name generated by the function given.
- example:
-
String -> Save(String: name) -> String
- example:
Save('foo')
- save the current String value to the name 'foo' in this thread
- example:
-
String -> Save(function.Function<Object,Object>: nameFunc) -> String
- example:
Save(NumberNameToString())
- save the current String value to a named variable in this thread, where the variable name is provided by a function
- example:
-
Object -> Save(String: name) -> Object
- example:
Save('foo')
- for the current thread, save the input object value to the named variable
- example:
-
Object -> Save(function.Function<Object,Object>: nameFunc) -> Object
- example:
Save(NumberNameToString())
- for the current thread, save the current input object value to the named variable,where the variable name is provided by a function.
- example:
-
double -> Save(String: name) -> double
- example:
Save('foo')
- for the current thread, save the current double value to the named variable.
- example:
-
double -> Save(function.Function<Object,Object>: nameFunc) -> double
- example:
Save(NumberNameToString())
- for the current thread, save the current double value to the name 'foo' in this thread, where the variable name is provided by a function.
- example:
-
int -> Save(String: name) -> int
- example:
Save('foo')
- save the current int value to the name 'foo' in this thread
- example:
-
int -> Save(function.Function<Object,Object>: nameFunc) -> int
- example:
Save(NumberNameToString())
- save the current int value to a named variable in this thread,where the variable name is provided by a function.
- example:
SaveDouble
Save a value to a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. Note that the input type is not that suitable for constructing names, so this is more likely to be used in an indirect naming pattern like SaveDouble(Load('id'))
-
double -> SaveDouble(String: name) -> double
- example:
Save('foo')
- save the current double value to the name 'foo' in this thread
- example:
-
double -> SaveDouble(function.Function<Object,Object>: nameFunc) -> double
- example:
Save(NumberNameToString())
- save a double value to a named variable in the current thread, where the variable name is provided by a function.
- example:
-
long -> SaveDouble(String: name) -> double
- example:
Save('foo')
- save the current double value to the name 'foo' in this thread
- example:
-
long -> SaveDouble(function.LongFunction<Object>: nameFunc) -> double
- example:
Save(NumberNameToString())
- save a double value to a named variable in the current thread, where the variable name is provided by a function.
- example:
SaveFloat
Save a value to a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. Note that the input type is not that suitable for constructing names, so this is more likely to be used in an indirect naming pattern like SaveFloat(Load('id'))
-
long -> SaveFloat(String: name) -> Float
- example:
SaveFloat('foo')
- save the current float value to a named variable in this thread.
- example:
-
long -> SaveFloat(function.LongFunction<Object>: nameFunc) -> Float
- example:
SaveFloat(NumberNameToString())
- save the current float value to a named variable in this thread, where the variable name is provided by a function.
- example:
-
Float -> SaveFloat(String: name) -> Float
- example:
SaveFloat('foo')
- save the current float value to a named variable in this thread.
- example:
-
Float -> SaveFloat(function.Function<Object,Object>: nameFunc) -> Float
- example:
SaveFloat(NumberNameToString())
- save the current float value to a named variable in this thread, where the variable name is provided by a function.
- example:
SaveInteger
Save a value to a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. Note that the input type is not that suitable for constructing names, so this is more likely to be used in an indirect naming pattern like SaveInteger(Load('id'))
-
int -> SaveInteger(String: name) -> int
- example:
SaveInteger('foo')
- save the current integer value to a named variable in this thread.
- example:
-
int -> SaveInteger(function.Function<Object,Object>: nameFunc) -> int
- example:
SaveInteger(NumberNameToString())
- save the current integer value to a named variable in this thread, where the variable name is provided by a function.
- example:
-
long -> SaveInteger(String: name) -> int
- example:
SaveInteger('foo')
- save the current integer value to a named variable in this thread.
- example:
-
long -> SaveInteger(function.LongFunction<Object>: nameFunc) -> int
- example:
SaveInteger(NumberNameToString())
- save the current integer value to a named variable in this thread, where the variable name is provided by a function.
- example:
SaveLong
Save a value to a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. Note that the input type is not that suitable for constructing names, so this is more likely to be used in an indirect naming pattern like SaveLong(Load('id'))
-
long -> SaveLong(String: name) -> long
- example:
SaveLong('foo')
- save the current long value to a named variable in this thread.
- example:
-
long -> SaveLong(function.Function<Object,Object>: nameFunc) -> long
- example:
SaveLong(NumberNameToString())
- save the current long value to a named variable in this thread, where the variable name is provided by a function.
- example:
-
long -> SaveLong(String: name) -> long
- example:
SaveLong('foo')
- save the current long value to a named variable in this thread.
- example:
-
long -> SaveLong(function.Function<Object,Object>: nameFunc) -> long
- example:
SaveLong(NumberNameToString())
- save the current long value to a named variable in this thread, where the variable name is provided by a function.
- example:
SaveString
Save a value to a named thread-local variable, where the variable name is fixed or a generated variable name from a provided function. Note that the input type is not that suitable for constructing names, so this is more likely to be used in an indirect naming pattern like SaveString(Load('id'))
-
long -> SaveString(String: name) -> String
- example:
SaveString('foo')
- save the current String value to a named variable in this thread.
- example:
-
long -> SaveString(function.LongFunction<Object>: nameFunc) -> String
- example:
SaveString(NumberNameToString())
- save the current String value to a named variable in this thread, where the variable name is provided by a function.
- example:
-
String -> SaveString(String: name) -> String
- example:
SaveString('foo')
- save the current String value to a named variable in this thread.
- example:
-
String -> SaveString(function.Function<Object,Object>: nameFunc) -> String
- example:
SaveString(NumberNameToString())
- save the current String value to a named variable in this thread, where the variable name is provided by a function.
- example:
Show
Show diagnostic values for the thread-local variable map.
-
long -> Show() -> String
- example:
Show()
- Show all values in a json-like format
- example:
-
long -> Show(String[]...: names) -> String
- example:
Show('foo')
- Show only the 'foo' value in a json-like format
- example:
Show('foo','bar')
- Show the 'foo' and 'bar' values in a json-like format
- example:
-
Object -> Show() -> String
- example:
Show()
- Show all values in a json-like format
- example:
-
Object -> Show(String[]...: names) -> String
- example:
Show('foo')
- Show only the 'foo' value in a json-like format
- example:
Show('foo','bar')
- Show the 'foo' and 'bar' values in a json-like format
- example:
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.
-
Object -> Swap(String: name) -> Object
- example:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable
- example:
-
Object -> Swap(String: name, Object: defaultValue) -> Object
- example:
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.
- example:
-
Object -> Swap(function.Function<Object,Object>: nameFunc) -> Object
- example:
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.
- example:
-
Object -> Swap(function.Function<Object,Object>: nameFunc, Object: defaultValue) -> Object
- example:
Swap(NumberNameToString(),'examplevalue')
- 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 value is not defined.
- example:
-
long -> Swap(String: name) -> Object
- example:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable
- example:
-
long -> Swap(String: name, Object: defaultValue) -> Object
- example:
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.
- example:
-
long -> Swap(function.LongFunction<Object>: nameFunc) -> Object
- example:
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.
- example:
-
long -> Swap(function.LongFunction<Object>: nameFunc, Object: defaultValue) -> Object
- example:
Swap(NumberNameToString(),'examplevalue')
- 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 value is not defined.
- example:
-
long -> Swap(String: name) -> long
- example:
Swap('foo')
- for the current thread, swap the input value with the named variable and returned the named variable.
- example:
-
long -> Swap(String: name, long: defaultValue) -> long
- example:
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.
- example:
-
long -> Swap(function.LongFunction<String>: nameFunc) -> long
- example:
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.
- example:
-
long -> Swap(function.LongFunction<String>: nameFunc, long: defaultValue) -> long
- example:
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.
- example:
ThreadNum
Matches a digit sequence in the current thread name and caches it in a thread local. This allows you to use any intentionally indexed thread factories to provide an analogue for concurrency. Note that once the thread number is cached, it will not be refreshed. This means you can't change the thread name and get an updated value.
-
long -> ThreadNum() -> int
-
long -> ThreadNum() -> long
UnsetOrLoad
Reads a long variable from the input, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return UNSET.value or a loaded value.
long -> UnsetOrLoad(double: ratio, String: varname) -> Object
UnsetOrPass
Reads a long variable from the thread local variable map, hashes and scales it to the unit interval 0.0d - 1.0d, then uses the result to determine whether to return UNSET.value or the input value.
Object -> UnsetOrPass(double: ratio, String: varname) -> Object