public class GET extends NamedWarpScriptFunction implements WarpScriptStackFunction
| Constructor and Description |
|---|
GET(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
apply(WarpScriptStack stack) |
static int |
computeAndCheckIndex(int index,
int size) |
static java.lang.Object |
get(java.lang.Object key,
java.lang.Object collection)
Get a value from a List, Map, byte[] or String using respectively a Long, Object, Long or Long key.
|
static java.lang.Object |
nestedGet(java.util.List<java.lang.Object> nestedList,
java.util.List<java.lang.Long> indexList) |
getName, refSnapshot, setName, toStringpublic java.lang.Object apply(WarpScriptStack stack) throws WarpScriptException
apply in interface WarpScriptStackFunctionWarpScriptExceptionpublic static java.lang.Object get(java.lang.Object key,
java.lang.Object collection)
throws WarpScriptException
key - Either an Object for a Map or a Long for List, byte[] or String. Negative indexing is possible, in that case the corresponding index is size + index.collection - Either a List, Map, byte[] or String instance.WarpScriptException - If the collection type cannot be handled or the key is invalid for the collection type.public static int computeAndCheckIndex(int index,
int size)
throws WarpScriptException
WarpScriptExceptionpublic static java.lang.Object nestedGet(java.util.List<java.lang.Object> nestedList,
java.util.List<java.lang.Long> indexList)
throws WarpScriptException
WarpScriptException