Package sleep.bridges
Class KeyValuePair
- java.lang.Object
-
- sleep.bridges.KeyValuePair
-
public class KeyValuePair extends java.lang.ObjectArguments passed to functions with the form
key => expressionare available via the KeyValuePair object. The following is the implementation of the built-in function&hash(key => "value", key2 => 3, ...):class hash implements Function { public Scalar evaluate(String n, ScriptInstance si, Stack arguments) { Scalar value = SleepUtils.getHashScalar(); while (!arguments.isEmpty()) { KeyValuePair kvp = BridgeUtilities.getKeyValuePair(arguments); Scalar blah = value.getHash().getAt(kvp.getKey()); blah.setValue(kvp.getValue()); } return value; } }- See Also:
BridgeUtilities
-
-
Constructor Summary
Constructors Constructor Description KeyValuePair(Scalar _key, Scalar _value)Instantiates a key/value pair
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScalargetKey()Obtain the key portion of this pairScalargetValue()Obtain the value portion of this pairjava.lang.StringtoString()Return a string representation of this key/value pair
-