A `List` which can be efficiently searched for occurrences of a given element, or for inclusions of a given sublist of elements. This interface provides operations for finding:

- occurrences of a single value in the list, and
- inclusions of a given sublist of values in the list.

Occurrences and inclusions are identified by a list index at which the value or sublist of values occurs in the list. In the case of an inclusion, it is the index of the first matching value from the sublist.

Inclusions may overlap. For example:

    "yoyoyoyoyo".inclusions("yoy")

produces the stream `{ 0, 2, 4, 6 }`.

An empty list is considered to be included at every index, including the index `List.size` at the very end of the list. Thus:

    "hello".inclusions("")

produces the stream `{ 0, 1, 2, 3, 4, 5 }`, with 6 inclusions in a string of length 5.

In particular:

- `"".inclusions("x")` is the empty stream `{}`, but
- `"".inclusions("")` is the stream `{ 0 }`.

See also `String`, `Array`

no type hierarchy

- `SearchableList`
  - `List`
    - `Collection`
      - `Iterable`
        - `Category`
    - `Correspondence`
    - `Ranged`
      - `Iterable`
        - `Category`

- `SearchableList`
  - `Array`
  - `String`

Inherited Attributes
Attributes inherited from: `Object` `hash`, `string`
Attributes inherited from: `Collection<Element>` `empty`, `permutations`, `string`
Attributes inherited from: `Correspondence<Key,Item>` `keys`
Attributes inherited from: `Iterable<Element,Absent>` `coalesced`, `cycled`, `distinct`, `empty`, `exceptLast`, `first`, `indexed`, `last`, `paired`, `rest`, `size`, `string`
Attributes inherited from: `List<Element>` `first`, `hash`, `keys`, `last`, `lastIndex`, `rest`, `reversed`, `size`

Methods
`firstInclusion` | Source Code `shared default Integer? firstInclusion(List<Element> sublist, Integer from = 0)` The first index in this list at which the given list occurs as a sublist, that is greater than or equal to the optional starting index. Parameters: `from = 0` The smallest index to consider.
`firstOccurrence` | Source Code `shared default Integer? firstOccurrence(Element element, Integer from = 0, Integer length = ...)` The first index in this list at which the given value occurs, that falls within the segment `from:length` defined by the optional starting index and `length`. Parameters: `element` The value. If null, it is considered to occur at any index in this list with a null element. `from = 0` The smallest index to consider. `length = size-from` The number of indexes to consider.
`includes` | Source Code `shared default Boolean includes(List<Element> sublist, Integer from = 0)` Determine if the given list occurs as a sublist at some index in this list, at any index that is greater than or equal to the optional starting index. Parameters: `from = 0` The smallest index to consider.
`includesAt` | Source Code `shared default Boolean includesAt(Integer index, List<Element> sublist)` Determine if the given list occurs as a sublist at the given index of this list. Parameters: `index` The index at which the `sublist` might occur.
`inclusions` | Source Code `shared default {Integer*} inclusions(List<Element> sublist, Integer from = 0)` The indexes in this list at which the given list occurs as a sublist, that are greater than or equal to the optional starting index. Parameters: `from = 0` The smallest index to consider.
`lastInclusion` | Source Code `shared default Integer? lastInclusion(List<Element> sublist, Integer from = 0)` The last index in this list at which the given list occurs as a sublist, that falls within the range `0:size-from+1-sublist.size` defined by the optional starting index, interpreted as a reverse index counting from the end of the list. Parameters: `from = 0` The smallest index to consider, interpreted as a reverse index counting from the end of the list, where `0` is the last element of the list, and `size-1` is the first element of the list.
`lastOccurrence` | Source Code `shared default Integer? lastOccurrence(Element element, Integer from = 0, Integer length = ...)` The last index in this list at which the given value occurs, that falls within the range `size-length-from:length` defined by the optional starting index, interpreted as a reverse index counting from the end of the list, and `length`. Parameters: `element` The value. If null, it is considered to occur at any index in this list with a null element. `from = 0` The smallest index to consider, interpreted as a reverse index counting from the end of the list, where `0` is the last element of the list, and `size-1` is the first element of the list. `length = size-from` The number of indexes to consider.
`occurrences` | Source Code `shared default {Integer*} occurrences(Element element, Integer from = 0, Integer length = ...)` The indexes in this list at which the given value occurs. Parameters: `element` The value. If null, it is considered to occur at any index in this list with a null element. `from = 0` The smallest index to consider. `length = size-from` The number of indexes to consider.
`occurs` | Source Code `shared default Boolean occurs(Element element, Integer from = 0, Integer length = ...)` Determines if the given value occurs as an element of this list, at any index that falls within the segment `from:length` defined by the optional starting index and `length`. Parameters: `element` The value. If null, it is considered to occur at any index in this list with a null element. `from = 0` The smallest index to consider. `length = size-from` The number of indexes to consider.
`occursAt` | Source Code `shared default Boolean occursAt(Integer index, Element element)` Determines if the given value occurs at the given index in this list. Parameters: `index` The index at which the value might occur. `element` The value. If null, it is considered to occur at any index in this list with a null element.

Inherited Methods
Methods inherited from: `Object` `equals()`
Methods inherited from: `Category<Element>` `contains()`, `containsAny()`, `containsEvery()`
Methods inherited from: `Collection<Element>` `clone()`, `contains()`
Methods inherited from: `Correspondence<Key,Item>` `defines()`, `definesAny()`, `definesEvery()`, `get()`, `getAll()`
Methods inherited from: `Iterable<Element,Absent>` `any()`, `by()`, `chain()`, `collect()`, `contains()`, `count()`, `defaultNullElements()`, `each()`, `every()`, `filter()`, `find()`, `findLast()`, `flatMap()`, `fold()`, `follow()`, `frequencies()`, `getFromFirst()`, `group()`, `indexes()`, `interpose()`, `iterator()`, `locate()`, `locateLast()`, `locations()`, `longerThan()`, `map()`, `max()`, `narrow()`, `partition()`, `product()`, `reduce()`, `repeat()`, `scan()`, `select()`, `sequence()`, `shorterThan()`, `skip()`, `skipWhile()`, `sort()`, `spread()`, `summarize()`, `tabulate()`, `take()`, `takeWhile()`
Methods inherited from: `List<Element>` `clone()`, `collect()`, `contains()`, `defines()`, `endsWith()`, `equals()`, `find()`, `findLast()`, `firstIndexWhere()`, `get()`, `getFromFirst()`, `getFromLast()`, `indexesWhere()`, `initial()`, `iterator()`, `lastIndexWhere()`, `longerThan()`, `measure()`, `patch()`, `repeat()`, `shorterThan()`, `slice()`, `span()`, `spanFrom()`, `spanTo()`, `startsWith()`, `sublist()`, `sublistFrom()`, `sublistTo()`, `terminal()`, `trim()`, `trimLeading()`, `trimTrailing()`
Methods inherited from: `Ranged<Index,Element,Subrange>` `measure()`, `span()`, `spanFrom()`, `spanTo()`