示例#1
0
 @Override
 public void updateSettings() {
   if (algorithm != null) {
     algorithm.giveDoubleSettings(
         portfolioTable.getAlgortihmSettings().getCurrentDoubleSettings());
     algorithm.giveLongSettings(portfolioTable.getAlgortihmSettings().getCurrentLongSettings());
   }
 }
示例#2
0
 @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;
 }
示例#4
0
 @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());
 }