You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

There also exist algebraic operators (+,  -) to concatenate or subtract lists.

asList(Object o)

Makes a cast to the object o to state, that this object is a list. Cannot be used for list creation. Use toList for this.

toList(Object o)

Creates a new list with given input o.

Remark: You can also use:

toList(Object o, Object o),toList(Object o, Object o, Object o), ..., toList(Object o, Object o, Object o, Object o, Object o, Object o, Object o, Object o, Object o, Object o)

split(String list, String delimiter)

Creates from the csv-input string a new list by using the delimiter. The type of the list elements will be Object.

split(String list, String delimiter, String datatype)

Creates from the csv-input string a new list by using the delimiter. The type of the list elements will be datatype.

fill(List l, Number x, Object)

todo

<List>[Number x]

 Returns the object on position x of the given list, e.g. 'timestamps[0]'.

IndexOf(List l, Object o)

Returns the index of the given object in the given list.

IsEmpty(List l)

Return true if the given list is empty else false.

Size(List l)

Return the size of the list.

isEmpty(List l)

returns true, if the list contains no values.

elementAt(List l, int pos)

Return the element of the list l at pos. If the list is a variable or a constant list[pos] can be used.

first(List l)

returns the first element of the list. Same as <List>[0] or elementAt(l,0)

last(List l)

returns the last element of the list.

rest(List l)

returns a new list containing every element, except the first element.

sublist(List l, Number from [, Number to])

Returns a new List containing the elements from position from to position to. If to is not given, the function returns the sublist, starting an from.

rnd(List l)

Returns a random element from the list.

contains(List l, Object elem)

Returns true, if element is part of the list. Equivalent to indexOf(l, elem) >= 0.

indexOf(List l, Object elem)

Returns the position of the object elem inside the list. Returns -1 if elem is not found

max(List l)

Returns the highest element in the list

max(List<Tuple> l, Number pos)

Returns the highest element in the list. Here the elements are treated as Tuples and pos is the number of the attribute that should be used for comparing

min(list l)

returns the lowest element in the list

min(List<Tuple> l, Number pos)

Returns the lowest element in the list. Here the elements are treated as Tuples and pos is the number of the attribute that should be used for comparing.

sum(List l)

Returns the sum of all values in the List.

filter(List l, String predicate)

Executes the predicate on each element in the list and returns a filtered list

removeDuplicates(List l)

returns a new list where duplicates are removed

ListProject(List<Tuple> l, String positions)

Restricts each Tuple in the list to the given attribute positions. positions must be a comma seperated string (e.g., "1,4,7").

foreach(List l, String expression)

Perform the given expression on each element in the list and returns a list with the mapped elements.

foreachpair(List l, String expression)

Performs the given expression on each pair of input elements in the list, i.e. input list is treated as (e11,e12,e21,e22,e31,e32, ....)

all(List l, String expression)

Returns true, if the expression holds for all elements in the list

any(List l, String expression)

Returns true, if the expression is true for any element in the list

 

  • No labels