ChartDirector 7.0 (Java Edition)

Chart.bSearch2


Usage

public double bSearch2({Date[] | double[] | String[]} a, int startIndex, int len, {Date[] | double[] | String[]} v)

Description

Uses binary search to search for a value in an array segment.

This method is the same as Chart.bSearch except it only searches an array segment beginning from the given index and of the given length.

Arguments

ArgumentDefaultDescription
a(Mandatory)The array to be searched.
startIndex(Mandatory)The array index to begin the search
len(Mandatory)The number of elements to search.
v(Mandatory)The value to search for.

Return Value

The index of the value within the array segment. If the value is in between two elements of the array segment, this method returns a non-integer that interpolates the indexes of the two elements. If the value is smaller or larger than all the elements in the array segment, thie method returns the nearest index within the array segment.