@Override public void updateSettings() { if (algorithm != null) { algorithm.giveDoubleSettings( portfolioTable.getAlgortihmSettings().getCurrentDoubleSettings()); algorithm.giveLongSettings(portfolioTable.getAlgortihmSettings().getCurrentLongSettings()); } }
@Override public boolean updateAlgorithm() { boolean state = false; if (this.algorithm != null) { algorithm.update(); state = true; } return state; }
static float aggregate(final IAlgorithm algorithm, final float... values) { final int length = values.length; if (length == 0) { return 0; } float result = values[0]; for (int i = 1; i < length; i++) { result = algorithm.next(result, values[i]); } return result; }
@Override public String toString() { if (algorithm != null) return "Name: " + getName() + "Algorithm: " + algorithm.getName() + " Balance: " + FinancialLongConverter.toStringTwoDecimalPoints(getUnusedAmount()); else return "Name: " + getName() + " Balance: " + FinancialLongConverter.toStringTwoDecimalPoints(getUnusedAmount()); }