doc / ch.tutteli.atrium.logic.creating.charsequence.contains / CharSequenceContains / Searcher

Searcher

interface Searcher<S : CharSequenceContains.SearchBehaviour, SC>

Represents a searcher which supports the search behaviour S for a given input CharSequence of the search.

Parameters

S - The search behaviour which should be applied to the input CharSequence in which the Searcher will look for something -- the actual implementation of the search behaviour happens in the Searcher; SearchBehaviour only decorates the Translatable for reporting.

SC - The search criterion

Functions

search

abstract fun search(searchIn: CharSequence, searchFor: SC): Int

Searches in the given searchIn for the given searchFor, using its toString implementation, and returns the number of occurrences.

Inheritors

IgnoringCaseIndexSearcher

class IgnoringCaseIndexSearcher : CharSequenceContains.Searcher<IgnoringCaseSearchBehaviour, Any>

Represents a Searcher which implements the IgnoringCaseSearchBehaviour behaviour and uses CharSequence.indexOf to find expected objects.

IgnoringCaseRegexSearcher

class IgnoringCaseRegexSearcher : CharSequenceContains.Searcher<IgnoringCaseSearchBehaviour, String>

Represents a Searcher which implements the IgnoringCaseSearchBehaviour behaviour and evaluates the matches of a given regular expression on the input of the search.

IndexSearcher

class IndexSearcher : CharSequenceContains.Searcher<NoOpSearchBehaviour, Any>

Represents a Searcher which uses CharSequence.indexOf to find expected objects.

RegexSearcher

class RegexSearcher : CharSequenceContains.Searcher<NoOpSearchBehaviour, Regex>

Represents a Searcher which evaluates the matches of a given regular expression on the input of the search.