IfElseBinarySearchGenerator<T> class

IfElseBinarySearchGenerator is generator that generates source code of branching (if/else if/else) statements implementing balanced binary search.

Constructors

IfElseBinarySearchGenerator({required String callback(MapEntry<Range, T> entry), 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
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