dict
Creates a dict.
Used in the following format, where key
and value
may be one or more expressions:
dict({key}, {value}*)
The elements of the dict may be any type.
Examples
Takes an even number of parameters
dict(1 "a", 2, time(9, 30, 0)) # value { 1 -> "a" 2 -> 9:30:00 }
dictRetrieve
Lookup value in dict. If key is not found, and no default is specified, an exception will be thrown which should result a node error.
Used in the following format, where key
may be one or more expressions, dict
is the name of a dict to retrieve values from and default
is the default value if key
is not found:
dictRetrieve(dict1, key, {default})
dict1.dictRetrieve(key, {default})
The return value type varies.
Examples
exampleDict = dict("a", 1, "b", 2)dictRetrieve(exampleDict, "a", null)
exampleDict.dictRetrieve("a", null)
dictStore
Set value associated with key in the hash in the returned dictionary.
Used in the following format, where key
may be one or more expressions, dict
is the name of a dict to retrieve values from and value
is the value to insert into the dict:
dictStore(dict1, key, {value})
dict1.dictStore(key, {value})
The return value type varies.
Examples
dict1 = dictStore(dict0, "a", 3) // dict0 is unchanged, dict1 contains the new value.
dict1 = dict0.dictStore("a", 3)
hashCode
Returns a hash value for a given value.
Used in the following format, where param
must be a value:
hashCode(param)
param.hashCode()
The return value type is an integer.
Examples
hashCode('MyColumn') # value: 83452394
'MyColumn'.hashCode() # value: 83452394
hashCode(list('MyColumn', 'MyOtherColumn')) # value: 32423285
list('MyColumn', 'MyOtherColumn').hashCode() # value: 32423285
inDict
Returns true if the specified key is in the dict, false otherwise.
Used in the following format, where key
may be one or more expressions and dict
is the name of a dict to retrieve values from:
inDict(dict, key)
dict.inDict(key)
The return value type is a Boolean.
Examples
exampleDict = dict("a", 1, "b", 2)inDict(exampleDict, "a")
exampleDict.inDict("a")