Interface Search
access this type via: data.query.Search (provides, requires or uses)
Search for values in an array.
Functions
Data[] find(Data list[], TypeField field, Data template)
Data findFirst(Data list[], TypeField field, Data template)
int[] findIndex(Data list[], TypeField field, Data template)
int findFirstIndex(Data list[], TypeField field, Data template)
Data[] findDuplicates(Data list[], TypeField field)
Group[] groupBy(Data list[], TypeField field)
Data[] find(Data list[], TypeField field, Data template)
Search an array for cells matching a template, returning all matching cells.
list The array to search.
field The field to search against.
template An instance of the same type as the data held in list, in which the field to match against is set to the value being searched for.
returns: An array of cells matching the search term.
Data findFirst(Data list[], TypeField field, Data template)
Search an array for a cell matching a template, returning the first matching cell.
list The array to search.
field The field to search against.
template An instance of the same type as the data held in list, in which the field to match against is set to the value being searched for.
returns: The first cell matching the search term.
int[] findIndex(Data list[], TypeField field, Data template)
Search an array for cells matching a template, returning the indices of all matching cells.
list The array to search.
field The field to search against.
template An instance of the same type as the data held in list, in which the field to match against is set to the value being searched for.
returns: An array of indices of cells matching the search term.
int findFirstIndex(Data list[], TypeField field, Data template)
Search an array for a cell matching a template, returning the index of the first matching cell.
list The array to search.
field The field to search against.
template An instance of the same type as the data held in list, in which the field to match against is set to the value being searched for.
returns: The index of the first matching cell, or INT_MAX for no match.
Data[] findDuplicates(Data list[], TypeField field)
Search an array for cells that have the same value for the given field.
list The array to search.
field The field to find duplicates of.
returns: An array of cells that have duplicates in the source list.
Group[] groupBy(Data list[], TypeField field)
Search an array for cells that have the same value for the given field, grouping those cells together.
list The array to search.
field The field to group by.
returns: An array of groups, each one containing the cells in that group.