public final class ListExp extends Object
Exp
.
The bin expression argument in these methods can be a reference to a bin or the result of another expression. Expressions that modify bin values are only used for temporary expression evaluation and are not permanently applied to the bin.
List modify expressions return the bin's value. This value will be a list except when the list is nested within a map. In that case, a map is returned for the list modify expression.
List expressions support negative indexing. If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. If a range is partially out of bounds, the valid part of the range will be returned. Index/Range examples:
Nested expressions are supported by optional CTX context arguments. Example:
Constructor and Description |
---|
ListExp() |
Modifier and Type | Method and Description |
---|---|
static Exp |
append(ListPolicy policy,
Exp value,
Exp bin,
CTX... ctx)
Create expression that appends value to end of list.
|
static Exp |
appendItems(ListPolicy policy,
Exp list,
Exp bin,
CTX... ctx)
Create expression that appends list items to end of list.
|
static Exp |
clear(Exp bin,
CTX... ctx)
Create expression that removes all items in list.
|
static Exp |
getByIndex(int returnType,
Exp.Type valueType,
Exp index,
Exp bin,
CTX... ctx)
Create expression that selects list item identified by index and returns
selected data specified by returnType.
|
static Exp |
getByIndexRange(int returnType,
Exp index,
Exp bin,
CTX... ctx)
Create expression that selects list items starting at specified index to the end of list
and returns selected data specified by returnType (See
ListReturnType ). |
static Exp |
getByIndexRange(int returnType,
Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects "count" list items starting at specified index
and returns selected data specified by returnType (See
ListReturnType ). |
static Exp |
getByRank(int returnType,
Exp.Type valueType,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects list item identified by rank and returns selected
data specified by returnType.
|
static Exp |
getByRankRange(int returnType,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects list items starting at specified rank to the last ranked item
and returns selected data specified by returnType (See
ListReturnType ). |
static Exp |
getByRankRange(int returnType,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects "count" list items starting at specified rank and returns
selected data specified by returnType (See
ListReturnType ). |
static Exp |
getByValue(int returnType,
Exp value,
Exp bin,
CTX... ctx)
Create expression that selects list items identified by value and returns selected
data specified by returnType.
|
static Exp |
getByValueList(int returnType,
Exp values,
Exp bin,
CTX... ctx)
Create expression that selects list items identified by values and returns selected data
specified by returnType.
|
static Exp |
getByValueRange(int returnType,
Exp valueBegin,
Exp valueEnd,
Exp bin,
CTX... ctx)
Create expression that selects list items identified by value range and returns selected data
specified by returnType.
|
static Exp |
getByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that selects list items nearest to value and greater by relative rank
and returns selected data specified by returnType (See
ListReturnType ). |
static Exp |
getByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that selects list items nearest to value and greater by relative rank with a count limit
and returns selected data specified by returnType (See
ListReturnType ). |
static Exp |
increment(ListPolicy policy,
Exp index,
Exp value,
Exp bin,
CTX... ctx)
Create expression that increments list[index] by value.
|
static Exp |
insert(ListPolicy policy,
Exp index,
Exp value,
Exp bin,
CTX... ctx)
Create expression that inserts value to specified index of list.
|
static Exp |
insertItems(ListPolicy policy,
Exp index,
Exp list,
Exp bin,
CTX... ctx)
Create expression that inserts each input list item starting at specified index of list.
|
static Exp |
removeByIndex(Exp index,
Exp bin,
CTX... ctx)
Create expression that removes list item identified by index.
|
static Exp |
removeByIndexRange(int returnType,
Exp index,
Exp bin,
CTX... ctx)
Create expression that removes list items starting at specified index to the end of list.
|
static Exp |
removeByIndexRange(int returnType,
Exp index,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes "count" list items starting at specified index.
|
static Exp |
removeByRank(Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes list item identified by rank.
|
static Exp |
removeByRankRange(int returnType,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes list items starting at specified rank to the last ranked item.
|
static Exp |
removeByRankRange(int returnType,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes "count" list items starting at specified rank.
|
static Exp |
removeByValue(int returnType,
Exp value,
Exp bin,
CTX... ctx)
Create expression that removes list items identified by value.
|
static Exp |
removeByValueList(int returnType,
Exp values,
Exp bin,
CTX... ctx)
Create expression that removes list items identified by values.
|
static Exp |
removeByValueRange(int returnType,
Exp valueBegin,
Exp valueEnd,
Exp bin,
CTX... ctx)
Create expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive).
|
static Exp |
removeByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp bin,
CTX... ctx)
Create expression that removes list items nearest to value and greater by relative rank.
|
static Exp |
removeByValueRelativeRankRange(int returnType,
Exp value,
Exp rank,
Exp count,
Exp bin,
CTX... ctx)
Create expression that removes list items nearest to value and greater by relative rank with a count limit.
|
static Exp |
set(ListPolicy policy,
Exp index,
Exp value,
Exp bin,
CTX... ctx)
Create expression that sets item value at specified index in list.
|
static Exp |
size(Exp bin,
CTX... ctx)
Create expression that returns list size.
|
static Exp |
sort(int sortFlags,
Exp bin,
CTX... ctx)
Create expression that sorts list according to sortFlags.
|
public static Exp append(ListPolicy policy, Exp value, Exp bin, CTX... ctx)
public static Exp appendItems(ListPolicy policy, Exp list, Exp bin, CTX... ctx)
public static Exp insert(ListPolicy policy, Exp index, Exp value, Exp bin, CTX... ctx)
public static Exp insertItems(ListPolicy policy, Exp index, Exp list, Exp bin, CTX... ctx)
public static Exp increment(ListPolicy policy, Exp index, Exp value, Exp bin, CTX... ctx)
public static Exp set(ListPolicy policy, Exp index, Exp value, Exp bin, CTX... ctx)
public static Exp clear(Exp bin, CTX... ctx)
public static Exp sort(int sortFlags, Exp bin, CTX... ctx)
sortFlags
- sort flags. See ListSortFlags
.bin
- bin or list value expressionctx
- optional context path for nested CDTpublic static Exp removeByValue(int returnType, Exp value, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByValueList(int returnType, Exp values, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByValueRange(int returnType, Exp valueBegin, Exp valueEnd, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.
Examples for ordered list [0,4,5,9,11,15]:
public static Exp removeByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp count, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.
Examples for ordered list [0,4,5,9,11,15]:
public static Exp removeByIndex(Exp index, Exp bin, CTX... ctx)
public static Exp removeByIndexRange(int returnType, Exp index, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByIndexRange(int returnType, Exp index, Exp count, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByRank(Exp rank, Exp bin, CTX... ctx)
public static Exp removeByRankRange(int returnType, Exp rank, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp removeByRankRange(int returnType, Exp rank, Exp count, Exp bin, CTX... ctx)
ListReturnType.NONE
or
ListReturnType.INVERTED
.public static Exp size(Exp bin, CTX... ctx)
// List bin "a" size > 7
Exp.gt(ListExp.size(Exp.listBin("a")), Exp.val(7))
public static Exp getByValue(int returnType, Exp value, Exp bin, CTX... ctx)
// List bin "a" contains at least one item == "abc"
ListExp.getByValue(ListReturnType.EXISTS, Exp.val("abc"), Exp.listBin("a"))
returnType
- metadata attributes to return. See ListReturnType
value
- search expressionbin
- list bin or list value expressionctx
- optional context path for nested CDTpublic static Exp getByValueRange(int returnType, Exp valueBegin, Exp valueEnd, Exp bin, CTX... ctx)
// List bin "a" items >= 10 && items < 20
ListExp.getByValueRange(ListReturnType.VALUE, Exp.val(10), Exp.val(20), Exp.listBin("a"))
returnType
- metadata attributes to return. See ListReturnType
valueBegin
- begin expression inclusive. If null, range is less than valueEnd.valueEnd
- end expression exclusive. If null, range is greater than equal to valueBegin.bin
- bin or list value expressionctx
- optional context path for nested CDTpublic static Exp getByValueList(int returnType, Exp values, Exp bin, CTX... ctx)
public static Exp getByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp bin, CTX... ctx)
ListReturnType
).
Examples for ordered list [0,4,5,9,11,15]:
public static Exp getByValueRelativeRankRange(int returnType, Exp value, Exp rank, Exp count, Exp bin, CTX... ctx)
ListReturnType
).
Examples for ordered list [0,4,5,9,11,15]:
public static Exp getByIndex(int returnType, Exp.Type valueType, Exp index, Exp bin, CTX... ctx)
// a[3] == 5
Exp.eq(
ListExp.getByIndex(ListReturnType.VALUE, Exp.Type.INT, Exp.val(3), Exp.listBin("a")),
Exp.val(5));
returnType
- metadata attributes to return. See ListReturnType
valueType
- expected type of return valueindex
- list index expressionbin
- list bin or list value expressionctx
- optional context path for nested CDTpublic static Exp getByIndexRange(int returnType, Exp index, Exp bin, CTX... ctx)
ListReturnType
).public static Exp getByIndexRange(int returnType, Exp index, Exp count, Exp bin, CTX... ctx)
ListReturnType
).public static Exp getByRank(int returnType, Exp.Type valueType, Exp rank, Exp bin, CTX... ctx)
// Player with lowest score.
ListExp.getByRank(ListReturnType.VALUE, Type.STRING, Exp.val(0), Exp.listBin("a"))
returnType
- metadata attributes to return. See ListReturnType
valueType
- expected type of return valuerank
- rank expressionbin
- list bin or list value expressionctx
- optional context path for nested CDTpublic static Exp getByRankRange(int returnType, Exp rank, Exp bin, CTX... ctx)
ListReturnType
).Copyright © 2012–2024 Aerospike, Inc. All rights reserved.