com.dukascopy.api.indicators
Class IndicatorResult

java.lang.Object
  extended by com.dukascopy.api.indicators.IndicatorResult

public class IndicatorResult
extends Object

Contains index of first value in input, that has corresponding indicator value, and number of calculated elements. For example, function has lookback == 5, user sets input with 20 elements and calls calculate function with indexes from 3 to 12. In this case function has to calculate 10 elements, but it needs 5 elements for lookback, that means it can start only from index 5. In result IndicatorResult will have firstValueIndex set to 5 and numberOfElements set to 12 - 5 + 1 = 8. If user executes calculate with indexes from 7 to 15, then firstValueIndex will be 7 and numberOfElements - 9

Author:
Dmitry Shohov

Constructor Summary
IndicatorResult()
          Creates empty object.
IndicatorResult(int firstValueIndex, int numberOfElements)
          Creates result object and sets fields
 
Method Summary
 int getFirstValueIndex()
          Returns index of first element in input parameter(s), that has corresponding calculated value
 int getNumberOfElements()
          Returns number of elements in output array
 void setFirstValueIndex(int firstValueIndex)
          Sets index of first element in input parameter(s), that has corresponding calculated value
 void setNumberOfElements(int numberOfElements)
          Sets number of elements in output array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndicatorResult

public IndicatorResult()
Creates empty object. Use set... methods to set fields


IndicatorResult

public IndicatorResult(int firstValueIndex,
                       int numberOfElements)
Creates result object and sets fields

Parameters:
firstValueIndex - index of first element in input parameter(s), that has corresponding calculated value
numberOfElements - number of elements in output
Method Detail

getFirstValueIndex

public int getFirstValueIndex()
Returns index of first element in input parameter(s), that has corresponding calculated value

Returns:
index of first element in input parameter(s)

setFirstValueIndex

public void setFirstValueIndex(int firstValueIndex)
Sets index of first element in input parameter(s), that has corresponding calculated value

Parameters:
firstValueIndex - index of first element in input parameter(s)

getNumberOfElements

public int getNumberOfElements()
Returns number of elements in output array

Returns:
number of elements in output array

setNumberOfElements

public void setNumberOfElements(int numberOfElements)
Sets number of elements in output array

Parameters:
numberOfElements - number of elements in output array


Copyright © 2009. All Rights Reserved.