ITimeSeries.IsEmpty

Syntax

IsEmpty: Boolean;

Description

The IsEmpty property determines whether a series is empty.

Comments

Available values:

Example

Custom series calculation method is given in the example.

Add links to the MathFin, Ms, Transform system assemblies.

Function IsEmpty(Input: ITimeSeries): ITimeSeries;
Var
    TsCalc: TsCalculation;
    pContext: ITsCalculationContext;
    i: Integer;
    Output: ITimeSeries;
Begin
    // Check if an input series is empty
    If Not Input.IsEmpty
        // If series is not empty, calculate its base-10 logarithm
        Then
        TsCalc := New TsCalculation.Create;
            pContext := TsCalc.Current;
            Output := pContext.CreateTimeSeries;
            For i := Input.StartIndex To Input.EndIndex Do
                Output(i) := Math.Log10(Input(i));
            End For;
            // Return calculation results
            Return Output;
        // If series  is empty, return it without changes 
        Else
            Return Input;
    End If;
End Function IsEmpty;

The method calculates base-10 logarithm if series contains data.

See also:

ITimeSeries