TernaryBinarySearchGenerator<T> class

TernaryBinarySearchGenerator is a generator that generates the source code of the (ternary) expression for searching the value implementing balanced binary search.

Constructors

TernaryBinarySearchGenerator({required String callback(MapEntry<Range, T> entry), required String defaultValue, required Map<Range, T> map, required String name})

Properties

callback String Function(MapEntry<Range, T> entry)
Callback function to generate the output code for a matched range value.
final
defaultValue String
final
hashCode int
The hash code for this object.
no setterinherited
map Map<Range, T>
A map of non-overlapping (start, end) ranges to their associated values.
final
name String
The variable name being checked in the generated code (e.g., 'c').
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generate() String
Generates source code for binary search.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited