public class PriceRangeCalculationHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static double |
EPS |
static int |
MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER |
static int |
MAX_POSITIVE_PRICES_STEPS_MULTIPLIER_POWER |
static int[] |
PRICES_STEPS_MULTIPLIERS |
private static double[] |
pricesSteps |
Constructor and Description |
---|
PriceRangeCalculationHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
calculateAvailablePricesSteps() |
private static java.lang.String |
formatPriceNumber(double value,
int priceStepIndex)
Rounds integer numbers, format double values
|
private static CalculatePricesResult |
getCalculatePricesResultOrNull(int goodNumberStep,
int startingLine,
double minValue,
double maxValue,
double linesAtScreen) |
static Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo |
getGoodNumbersCalculation(double minValue,
double maxValue,
double linesCount)
Provides an implementation of price range calculation that displays only "good" numbers on axis (1, 2, 5, 10, 25, 50 * 10^2n and their multipliers)
|
static java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo> |
getGoodNumbersCalculation(double linesCount,
java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.InputPriceAxisInfo> inputInfo)
Invokes
getGoodNumbersCalculation(double, double, double) for every map entry |
static CalculatePricesResult |
getGoodNumbersPriceResult(double minValue,
double maxValue,
double linesCount)
Same as
getGoodNumbersCalculation(double, double, double) , different return typeYou don't need to use this method unless you want to see advanced parameters of best solution |
private static final double EPS
public static final int[] PRICES_STEPS_MULTIPLIERS
public static final int MAX_POSITIVE_PRICES_STEPS_MULTIPLIER_POWER
public static final int MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER
private static double[] pricesSteps
private static void calculateAvailablePricesSteps()
public static Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo getGoodNumbersCalculation(double minValue, double maxValue, double linesCount)
minValue
- minimal value of indicator on chart rangemaxValue
- maximum value of indicator on chart rangelinesCount
- number of visible horizontal lines, that can display labels. Note that this value is double.public static java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo> getGoodNumbersCalculation(double linesCount, java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.InputPriceAxisInfo> inputInfo)
getGoodNumbersCalculation(double, double, double)
for every map entrypublic static CalculatePricesResult getGoodNumbersPriceResult(double minValue, double maxValue, double linesCount)
getGoodNumbersCalculation(double, double, double)
, different return typeminValue
- minimal value of indicator on chart rangemaxValue
- maximum value of indicator on chart rangelinesCount
- number of visible horizontal lines, that can display labels. Note that this value is double.private static CalculatePricesResult getCalculatePricesResultOrNull(int goodNumberStep, int startingLine, double minValue, double maxValue, double linesAtScreen)
goodNumberStep
- startingLine
- limits
- linesAtScreen
- private static java.lang.String formatPriceNumber(double value, int priceStepIndex)
value
- priceStepIndex
-