Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. /**
  2. * returns a IndexCalculationResult based on this entity
  3. * @param flags
  4. * @param index
  5. * @return
  6. */
  7. public IndexCalculationResult transform(CalculationFlags flags, IndexDefinition index)
  8. {
  9. Map<String, Double> feedIds = this.usedTicks.getPricesMap();
  10. Map<String, Double> fxFeedIds = this.usedTicks.getFxRatesMap();
  11.  
  12. final IndexCalculationResult calculationResult = new IndexCalculationResult(index.getUniqueIdentifier(), index.ric, index.getVersion(), index.isin,
  13. this.indexValue, feedIds, fxFeedIds, flags.isClosingCalculation);
  14.  
  15. if (this.cashComponents != null)
  16. {
  17. calculationResult.cashComponents = this.cashComponents;
  18. }
  19. if (this.cashInterests != null)
  20. {
  21. calculationResult.cashInterests = this.cashInterests;
  22. }
  23. if (this.bondPaidCashs != null)
  24. {
  25. if (this.bondPaidCashs.hasCashCas())
  26. {
  27. calculationResult.cashCas = this.bondPaidCashs.getCashCas();
  28. }
  29. if (this.bondPaidCashs.hasCashCoupons())
  30. {
  31. calculationResult.cashCoupons = this.bondPaidCashs.getCashCoupons();
  32. }
  33. if (this.bondPaidCashs.hasCashSinks())
  34. {
  35. calculationResult.cashSinks = this.bondPaidCashs.getCashSinks();
  36. }
  37. }
  38.  
  39. if (this.bondInstrumentRatios != null)
  40. {
  41. calculationResult.bondInstrumentRatios = this.bondInstrumentRatios;
  42. }
  43.  
  44. calculationResult.params = this.params;
  45. calculationResult.isLastPeriodicCalculation = flags.isLastPeriodicCalculation;
  46.  
  47. calculationResult.additionalTickData = this.additionalTickData;
  48.  
  49. return calculationResult;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement