Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * returns a IndexCalculationResult based on this entity
- * @param flags
- * @param index
- * @return
- */
- public IndexCalculationResult transform(CalculationFlags flags, IndexDefinition index)
- {
- Map<String, Double> feedIds = this.usedTicks.getPricesMap();
- Map<String, Double> fxFeedIds = this.usedTicks.getFxRatesMap();
- final IndexCalculationResult calculationResult = new IndexCalculationResult(index.getUniqueIdentifier(), index.ric, index.getVersion(), index.isin,
- this.indexValue, feedIds, fxFeedIds, flags.isClosingCalculation);
- if (this.cashComponents != null)
- {
- calculationResult.cashComponents = this.cashComponents;
- }
- if (this.cashInterests != null)
- {
- calculationResult.cashInterests = this.cashInterests;
- }
- if (this.bondPaidCashs != null)
- {
- if (this.bondPaidCashs.hasCashCas())
- {
- calculationResult.cashCas = this.bondPaidCashs.getCashCas();
- }
- if (this.bondPaidCashs.hasCashCoupons())
- {
- calculationResult.cashCoupons = this.bondPaidCashs.getCashCoupons();
- }
- if (this.bondPaidCashs.hasCashSinks())
- {
- calculationResult.cashSinks = this.bondPaidCashs.getCashSinks();
- }
- }
- if (this.bondInstrumentRatios != null)
- {
- calculationResult.bondInstrumentRatios = this.bondInstrumentRatios;
- }
- calculationResult.params = this.params;
- calculationResult.isLastPeriodicCalculation = flags.isLastPeriodicCalculation;
- calculationResult.additionalTickData = this.additionalTickData;
- return calculationResult;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement