StandardCDXManager.java

  1. package org.drip.service.env;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  8.  * Copyright (C) 2018 Lakshmi Krishnamurthy
  9.  * Copyright (C) 2017 Lakshmi Krishnamurthy
  10.  * Copyright (C) 2016 Lakshmi Krishnamurthy
  11.  * Copyright (C) 2015 Lakshmi Krishnamurthy
  12.  * Copyright (C) 2014 Lakshmi Krishnamurthy
  13.  * Copyright (C) 2013 Lakshmi Krishnamurthy
  14.  * Copyright (C) 2012 Lakshmi Krishnamurthy
  15.  *
  16.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  17.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  18.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  19.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  20.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  21.  *      and computational support.
  22.  *  
  23.  *      https://lakshmidrip.github.io/DROP/
  24.  *  
  25.  *  DROP is composed of three modules:
  26.  *  
  27.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  28.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  29.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  30.  *
  31.  *  DROP Product Core implements libraries for the following:
  32.  *  - Fixed Income Analytics
  33.  *  - Loan Analytics
  34.  *  - Transaction Cost Analytics
  35.  *
  36.  *  DROP Portfolio Core implements libraries for the following:
  37.  *  - Asset Allocation Analytics
  38.  *  - Asset Liability Management Analytics
  39.  *  - Capital Estimation Analytics
  40.  *  - Exposure Analytics
  41.  *  - Margin Analytics
  42.  *  - XVA Analytics
  43.  *
  44.  *  DROP Computational Core implements libraries for the following:
  45.  *  - Algorithm Support
  46.  *  - Computation Support
  47.  *  - Function Analysis
  48.  *  - Model Validation
  49.  *  - Numerical Analysis
  50.  *  - Numerical Optimizer
  51.  *  - Spline Builder
  52.  *  - Statistical Learning
  53.  *
  54.  *  Documentation for DROP is Spread Over:
  55.  *
  56.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  57.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  58.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  59.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  60.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  61.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  62.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  63.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  64.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  65.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  66.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  67.  *
  68.  *  Licensed under the Apache License, Version 2.0 (the "License");
  69.  *      you may not use this file except in compliance with the License.
  70.  *  
  71.  *  You may obtain a copy of the License at
  72.  *      http://www.apache.org/licenses/LICENSE-2.0
  73.  *  
  74.  *  Unless required by applicable law or agreed to in writing, software
  75.  *      distributed under the License is distributed on an "AS IS" BASIS,
  76.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  77.  *  
  78.  *  See the License for the specific language governing permissions and
  79.  *      limitations under the License.
  80.  */

  81. /**
  82.  * <i>StandardCDXManager</i> implements the creation and the static details of the all the NA, EU, SovX,
  83.  * EMEA, and ASIA standardized CDS indices. It exposes the following functionality:
  84.  *
  85.  * <br><br>
  86.  *  <ul>
  87.  *      <li>
  88.  *          Retrieve the full set of pre-set/pre-loaded CDX names/descriptions.
  89.  *      </li>
  90.  *      <li>
  91.  *          Retrieve all the CDX's given an index name.
  92.  *      </li>
  93.  *      <li>
  94.  *          Get the index, index series, and the effective/maturity dates for a given CDX.
  95.  *      </li>
  96.  *      <li>
  97.  *          Get all the on-the-runs for an index, date, and tenor.
  98.  *      </li>
  99.  *      <li>
  100.  *          Retrieve the full basket product corresponding to NA/EU/ASIA IG/HY/EM and other available
  101.  *              standard CDX.
  102.  *      </li>
  103.  *      <li>
  104.  *          Build a custom CDX product.
  105.  *      </li>
  106.  *  </ul>
  107.  *
  108.  * <br><br>
  109.  *  <ul>
  110.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
  111.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationSupportLibrary.md">Computation Support</a></li>
  112.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/README.md">Environment, Product/Definition Containers, and Scenario/State Manipulation APIs</a></li>
  113.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/service/env/README.md">Library Module Loader Environment Manager</a></li>
  114.  *  </ul>
  115.  * <br><br>
  116.  *  
  117.  * @author Lakshmi Krishnamurthy
  118.  */

  119. public class StandardCDXManager {
  120.     private static org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.product.definition.BasketProduct>
  121.         _mapStandardCDX = null;
  122.     private static org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.product.params.StandardCDXParams>
  123.         _mapStandardCDXParams = null;
  124.     private static
  125.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.util.Map<org.drip.analytics.date.JulianDate,
  126.             java.lang.Integer>> _mmIndexFirstCouponSeries = null;
  127.     private static org.drip.analytics.support.CaseInsensitiveTreeMap<java.util.Map<java.lang.Integer,
  128.         org.drip.analytics.date.JulianDate>> _mmIndexSeriesFirstCoupon = null;

  129.     private static final boolean SetupStandardCDXParams()
  130.     {
  131.         _mapStandardCDXParams = new
  132.             org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.product.params.StandardCDXParams>();

  133.         try {
  134.             _mapStandardCDXParams.put ("CDX.NA.IG", new org.drip.product.params.StandardCDXParams (125,
  135.                 "USD", 0.01));

  136.             _mapStandardCDXParams.put ("CDX.NA.HY", new org.drip.product.params.StandardCDXParams (100,
  137.                 "USD", 0.05));

  138.             _mapStandardCDXParams.put ("CDX.NA.HVOL", new org.drip.product.params.StandardCDXParams (30,
  139.                 "USD", 0.01));

  140.             _mapStandardCDXParams.put ("CDX.NA.HIVOL", new org.drip.product.params.StandardCDXParams (30,
  141.                 "USD", 0.01));

  142.             _mapStandardCDXParams.put ("CDX.NA.XO", new org.drip.product.params.StandardCDXParams (35, "USD",
  143.                 0.034));

  144.             _mapStandardCDXParams.put ("CDX.NA.HY.BB", new org.drip.product.params.StandardCDXParams (40,
  145.                 "USD", 0.05));

  146.             _mapStandardCDXParams.put ("CDX.NA.HY.B", new org.drip.product.params.StandardCDXParams (37,
  147.                 "USD", 0.05));

  148.             _mapStandardCDXParams.put ("ITRX.EU.IG", new org.drip.product.params.StandardCDXParams (125,
  149.                 "EUR", 0.01));

  150.             _mapStandardCDXParams.put ("ITRAXX.EU.IG", new org.drip.product.params.StandardCDXParams (125,
  151.                 "EUR", 0.01));

  152.             _mapStandardCDXParams.put ("ITRX.EU.HVOL", new org.drip.product.params.StandardCDXParams (30,
  153.                 "EUR", 0.01));

  154.             _mapStandardCDXParams.put ("ITRAXX.EU.HVOL", new org.drip.product.params.StandardCDXParams (30,
  155.                 "EUR", 0.01));

  156.             _mapStandardCDXParams.put ("ITRX.EU.XO", new org.drip.product.params.StandardCDXParams (50,
  157.                 "EUR", 0.05));

  158.             _mapStandardCDXParams.put ("ITRAXX.EU.XO", new org.drip.product.params.StandardCDXParams (50,
  159.                 "EUR", 0.05));

  160.             _mapStandardCDXParams.put ("ITRX.EU.NONFIN", new org.drip.product.params.StandardCDXParams (50,
  161.                 "EUR", 0.05));

  162.             _mapStandardCDXParams.put ("ITRAXX.EU.NONFIN", new org.drip.product.params.StandardCDXParams (50,
  163.                 "EUR", 0.05));

  164.             _mapStandardCDXParams.put ("ITRX.EU.FINSNR", new org.drip.product.params.StandardCDXParams (20,
  165.                 "EUR", 0.01));

  166.             _mapStandardCDXParams.put ("ITRAXX.EU.FINSNR", new org.drip.product.params.StandardCDXParams (20,
  167.                 "EUR", 0.01));

  168.             _mapStandardCDXParams.put ("ITRX.EU.FINSUB", new org.drip.product.params.StandardCDXParams (20,
  169.                 "EUR", 0.01));

  170.             _mapStandardCDXParams.put ("ITRAXX.EU.FINSUB", new org.drip.product.params.StandardCDXParams (20,
  171.                 "EUR", 0.01));

  172.             return true;
  173.         } catch (java.lang.Exception e) {
  174.             e.printStackTrace();
  175.         }

  176.         return false;
  177.     }

  178.     private static final boolean UpdateIndexMaps (
  179.         final java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapDateSeries,
  180.         final java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesDate,
  181.         final org.drip.analytics.date.JulianDate dt,
  182.         final int iSeries)
  183.     {
  184.         mapDateSeries.put (dt, iSeries);

  185.         mapSeriesDate.put (iSeries, dt);

  186.         return true;
  187.     }

  188.     private static final boolean PresetNA_IG_HY_HVOL_HYBB_HYBSeries()
  189.     {
  190.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapDateSeries = new
  191.             java.util.TreeMap<org.drip.analytics.date.JulianDate, java.lang.Integer>();

  192.         java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesDate = new
  193.             java.util.TreeMap<java.lang.Integer, org.drip.analytics.date.JulianDate>();

  194.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  195.             (2014, 6, 20), 22);

  196.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  197.             (2013, 12, 20), 21);

  198.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  199.             (2013, 6, 20), 20);

  200.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  201.             (2012, 12, 20), 19);

  202.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  203.             (2012, 6, 20), 18);

  204.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  205.             (2011, 12, 20), 17);

  206.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  207.             (2011, 6, 20), 16);

  208.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  209.             (2010, 12, 20), 15);

  210.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  211.             (2010, 6, 20), 14);

  212.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  213.             (2009, 12, 20), 13);

  214.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  215.             (2009, 6, 20), 12);

  216.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  217.             (2008, 12, 20), 11);

  218.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  219.             (2008, 6, 20), 10);

  220.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  221.             (2007, 12, 20), 9);

  222.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  223.             (2007, 6, 20), 8);

  224.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  225.             (2006, 12, 20), 7);

  226.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  227.             (2006, 6, 20), 6);

  228.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  229.             (2005, 12, 20), 5);

  230.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  231.             (2005, 6, 20), 4);

  232.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  233.             (2004, 12, 20), 3);

  234.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  235.             (2004, 6, 20), 2);

  236.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  237.             (2003, 12, 20), 1);

  238.         _mmIndexFirstCouponSeries.put ("CDX.NA.IG", mapDateSeries);

  239.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.IG", mapSeriesDate);

  240.         _mmIndexFirstCouponSeries.put ("CDX.NA.HY", mapDateSeries);

  241.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.HY", mapSeriesDate);

  242.         _mmIndexFirstCouponSeries.put ("CDX.NA.HVOL", mapDateSeries);

  243.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.HVOL", mapSeriesDate);

  244.         _mmIndexFirstCouponSeries.put ("CDX.NA.HIVOL", mapDateSeries);

  245.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.HIVOL", mapSeriesDate);

  246.         _mmIndexFirstCouponSeries.put ("CDX.NA.HY.B", mapDateSeries);

  247.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.HY.B", mapSeriesDate);

  248.         _mmIndexFirstCouponSeries.put ("CDX.NA.HY.BB", mapDateSeries);

  249.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.HY.BB", mapSeriesDate);

  250.         return true;
  251.     }

  252.     private static final boolean PresetNAXOSeries()
  253.     {
  254.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapDateSeries = new
  255.             java.util.TreeMap<org.drip.analytics.date.JulianDate, java.lang.Integer>();

  256.         java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesDate = new
  257.             java.util.TreeMap<java.lang.Integer, org.drip.analytics.date.JulianDate>();

  258.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  259.             (2014, 6, 20), 16);

  260.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  261.             (2013, 12, 20), 15);

  262.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  263.             (2013, 6, 20), 14);

  264.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  265.             (2012, 12, 20), 13);

  266.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  267.             (2012, 6, 20), 12);

  268.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  269.             (2011, 12, 20), 11);

  270.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  271.             (2011, 6, 20), 10);

  272.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  273.             (2010, 12, 20), 9);

  274.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  275.             (2010, 6, 20), 8);

  276.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  277.             (2009, 12, 20), 7);

  278.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  279.             (2009, 6, 20), 6);

  280.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  281.             (2008, 12, 20), 5);

  282.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  283.             (2008, 6, 20), 4);

  284.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  285.             (2007, 12, 20), 3);

  286.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  287.             (2007, 6, 20), 2);

  288.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  289.             (2006, 12, 20), 1);

  290.         _mmIndexFirstCouponSeries.put ("CDX.NA.XO", mapDateSeries);

  291.         _mmIndexSeriesFirstCoupon.put ("CDX.NA.XO", mapSeriesDate);

  292.         return true;
  293.     }

  294.     private static final boolean PresetEMSeries()
  295.     {
  296.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapDateSeries = new
  297.             java.util.TreeMap<org.drip.analytics.date.JulianDate, java.lang.Integer>();

  298.         java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesDate = new
  299.             java.util.TreeMap<java.lang.Integer, org.drip.analytics.date.JulianDate>();

  300.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  301.             (2014, 6, 20), 21);

  302.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  303.             (2013, 12, 20), 20);

  304.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  305.             (2013, 6, 20), 19);

  306.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  307.             (2012, 12, 20), 18);

  308.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  309.             (2012, 6, 20), 17);

  310.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  311.             (2011, 12, 20), 16);

  312.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  313.             (2011, 6, 20), 15);

  314.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  315.             (2010, 12, 20), 14);

  316.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  317.             (2010, 6, 20), 13);

  318.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  319.             (2009, 12, 20), 12);

  320.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  321.             (2009, 6, 20), 11);

  322.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  323.             (2008, 12, 20), 10);

  324.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  325.             (2008, 6, 20), 9);

  326.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  327.             (2007, 12, 20), 8);

  328.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  329.             (2007, 6, 20), 7);

  330.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  331.             (2006, 12, 20), 6);

  332.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  333.             (2006, 6, 20), 5);

  334.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  335.             (2005, 12, 20), 4);

  336.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  337.             (2005, 6, 20), 3);

  338.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  339.             (2004, 12, 20), 2);

  340.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  341.             (2004, 6, 20), 1);

  342.         _mmIndexFirstCouponSeries.put ("CDX.EM", mapDateSeries);

  343.         _mmIndexSeriesFirstCoupon.put ("CDX.EM", mapSeriesDate);

  344.         return true;
  345.     }

  346.     private static final boolean PresetEUSeries()
  347.     {
  348.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapDateSeries = new
  349.             java.util.TreeMap<org.drip.analytics.date.JulianDate, java.lang.Integer>();

  350.         java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesDate = new
  351.             java.util.TreeMap<java.lang.Integer, org.drip.analytics.date.JulianDate>();

  352.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  353.             (2014, 6, 20), 20);

  354.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  355.             (2013, 12, 20), 19);

  356.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  357.             (2013, 6, 20), 18);

  358.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  359.             (2012, 12, 20), 17);

  360.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  361.             (2012, 6, 20), 16);

  362.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  363.             (2011, 12, 20), 15);

  364.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  365.             (2011, 6, 20), 14);

  366.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  367.             (2010, 12, 20), 13);

  368.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  369.             (2010, 6, 20), 12);

  370.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  371.             (2009, 12, 20), 11);

  372.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  373.             (2009, 6, 20), 10);

  374.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  375.             (2008, 12, 20), 9);

  376.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  377.             (2008, 6, 20), 8);

  378.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  379.             (2007, 12, 20), 7);

  380.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  381.             (2007, 6, 20), 6);

  382.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  383.             (2006, 12, 20), 5);

  384.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  385.             (2006, 6, 20), 4);

  386.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  387.             (2005, 12, 20), 3);

  388.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  389.             (2005, 6, 20), 2);

  390.         UpdateIndexMaps (mapDateSeries, mapSeriesDate, org.drip.analytics.date.DateUtil.CreateFromYMD
  391.             (2004, 12, 20), 1);

  392.         _mmIndexFirstCouponSeries.put ("ITRX.EU.IG", mapDateSeries);

  393.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.IG", mapSeriesDate);

  394.         _mmIndexFirstCouponSeries.put ("ITRX.EU.HVOL", mapDateSeries);

  395.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.HVOL", mapSeriesDate);

  396.         _mmIndexFirstCouponSeries.put ("ITRX.EU.HIVOL", mapDateSeries);

  397.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.HIVOL", mapSeriesDate);

  398.         _mmIndexFirstCouponSeries.put ("ITRX.EU.XO", mapDateSeries);

  399.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.XO", mapSeriesDate);

  400.         _mmIndexFirstCouponSeries.put ("ITRX.EU.FINSNR", mapDateSeries);

  401.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.FINSNR", mapSeriesDate);

  402.         _mmIndexFirstCouponSeries.put ("ITRX.EU.FINSUB", mapDateSeries);

  403.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.FINSUB", mapSeriesDate);

  404.         _mmIndexFirstCouponSeries.put ("ITRX.EU.NONFIN", mapDateSeries);

  405.         _mmIndexSeriesFirstCoupon.put ("ITRX.EU.NONFIN", mapSeriesDate);

  406.         return true;
  407.     }

  408.     public static final boolean InitStandardCDXSeries()
  409.     {
  410.         if (null != _mapStandardCDX) return true;

  411.         _mapStandardCDX = new
  412.             org.drip.analytics.support.CaseInsensitiveTreeMap<org.drip.product.definition.BasketProduct>();

  413.         _mmIndexFirstCouponSeries = new
  414.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.util.Map<org.drip.analytics.date.JulianDate,
  415.             java.lang.Integer>>();

  416.         _mmIndexSeriesFirstCoupon = new
  417.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.util.Map<java.lang.Integer,
  418.                 org.drip.analytics.date.JulianDate>>();

  419.         if (!PresetNA_IG_HY_HVOL_HYBB_HYBSeries()) {
  420.             System.out.println ("Cannot initialize NA_IG_HY_HVOL_HYBB_HYB");

  421.             return false;
  422.         }

  423.         if (!PresetNAXOSeries()) {
  424.             System.out.println ("Cannot initialize NA_XO");

  425.             return false;
  426.         }

  427.         if (!PresetEMSeries()) {
  428.             System.out.println ("Cannot initialize EM");

  429.             return false;
  430.         }

  431.         if (!PresetEUSeries()) {
  432.             System.out.println ("Cannot initialize EU");

  433.             return false;
  434.         }

  435.         if (!SetupStandardCDXParams()) {
  436.             System.out.println ("Cannot setup standard CDX Params!");

  437.             return false;
  438.         }

  439.         return org.drip.product.creator.CDXRefDataHolder.InitFullCDXRefDataSet();
  440.     }

  441.     private static final org.drip.product.definition.BasketProduct ConstructCDX (
  442.         final java.lang.String strTenor,
  443.         final org.drip.analytics.date.JulianDate dtFirstCoupon,
  444.         final double dblCoupon,
  445.         final java.lang.String strIR,
  446.         final int iNumComponents,
  447.         final java.lang.String strCDXName)
  448.     {
  449.         java.lang.String[] astrCC = new java.lang.String[iNumComponents];

  450.         for (int i = 0; i < iNumComponents; ++i)
  451.             astrCC[i] = "CC" + (i + 1);

  452.         return org.drip.product.creator.CDSBasketBuilder.MakeCDX (dtFirstCoupon.subtractTenor ("3M"),
  453.             dtFirstCoupon.addTenor (strTenor), dblCoupon, strIR, astrCC, strCDXName);
  454.     }

  455.     private static final org.drip.product.definition.BasketProduct ConstructCDXEM (
  456.         final java.lang.String strTenor,
  457.         final org.drip.analytics.date.JulianDate dtFirstCoupon,
  458.         final java.lang.String strCDXName)
  459.     {
  460.         return org.drip.product.creator.CDSBasketBuilder.MakeCDX (dtFirstCoupon.subtractTenor ("3M"),
  461.             dtFirstCoupon.addTenor (strTenor), 0.05, "USD", new java.lang.String[] {"ARG", "VEN", "BRA",
  462.                 "MAL", "COL", "HUN", "IND", "PAN", "PER", "SAF", "PHI", "TUR", "RUS", "UKR", "MEX"}, new
  463.                     double[] {0.06, 0.08, 0.13, 0.04, 0.08, 0.03, 0.05, 0.03, 0.05, 0.03, 0.06, 0.11, 0.13,
  464.                         0.03, 0.09}, strCDXName);
  465.     }

  466.     private static final org.drip.product.definition.BasketProduct MakePresetStandardCDX (
  467.         final java.lang.String strIndex,
  468.         final int iSeries,
  469.         final java.lang.String strTenor)
  470.     {
  471.         if (null == strIndex || strIndex.isEmpty() || null == strTenor || strTenor.isEmpty()) return null;

  472.         org.drip.product.params.CDXIdentifier cdxID = null;

  473.         try {
  474.             cdxID = new org.drip.product.params.CDXIdentifier (iSeries, 1, strIndex, strTenor);
  475.         } catch (java.lang.Exception e) {
  476.             e.printStackTrace();
  477.         }

  478.         if (null == cdxID) return null;

  479.         java.lang.String strCDXCode = cdxID.getCode();

  480.         if (null == strCDXCode || strCDXCode.isEmpty()) return null;

  481.         org.drip.product.definition.BasketProduct cdx = _mapStandardCDX.get (strCDXCode);

  482.         if (null != cdx) return cdx;

  483.         java.util.Map<java.lang.Integer, org.drip.analytics.date.JulianDate> mapSeriesFirstCoupon =
  484.             _mmIndexSeriesFirstCoupon.get (strIndex);

  485.         if (null == mapSeriesFirstCoupon) return null;

  486.         org.drip.analytics.date.JulianDate dtFirstCoupon = mapSeriesFirstCoupon.get (iSeries);

  487.         if (null == dtFirstCoupon) return null;

  488.         if ("CDX.EM".equalsIgnoreCase (strIndex))
  489.             cdx = ConstructCDXEM (strTenor, dtFirstCoupon, strCDXCode);
  490.         else {
  491.             org.drip.product.params.StandardCDXParams cdxParams = _mapStandardCDXParams.get (strIndex);

  492.             if (null != cdxParams)
  493.                 cdx = ConstructCDX (strTenor, dtFirstCoupon, cdxParams._dblCoupon, cdxParams._strCurrency,
  494.                     cdxParams._iNumComponents, strCDXCode);
  495.         }

  496.         _mapStandardCDX.put (strCDXCode, cdx);

  497.         return cdx;
  498.     }

  499.     private static final org.drip.product.definition.BasketProduct MakePreLoadedStandardCDX (
  500.         final java.lang.String strIndex,
  501.         final int iSeries,
  502.         final java.lang.String strTenor)
  503.     {
  504.         if (null == strIndex || strIndex.isEmpty() || null == strTenor || strTenor.isEmpty()) return null;

  505.         org.drip.product.params.CDXIdentifier cdxID = null;

  506.         try {
  507.             cdxID = new org.drip.product.params.CDXIdentifier (iSeries, 1, strIndex, strTenor);
  508.         } catch (java.lang.Exception e) {
  509.             e.printStackTrace();
  510.         }

  511.         if (null == cdxID) return null;

  512.         java.lang.String strCDXCode = cdxID.getCode();

  513.         if (null == strCDXCode || strCDXCode.isEmpty()) return null;

  514.         org.drip.product.params.CDXRefDataParams cdxrdb =
  515.             org.drip.product.creator.CDXRefDataHolder._mapCDXRefData.get (strCDXCode);

  516.         if (null == cdxrdb) return null;

  517.         java.lang.String[] astrCC = new java.lang.String[cdxrdb._iOriginalComponentCount];

  518.         for (int i = 0; i < cdxrdb._iOriginalComponentCount; ++i)
  519.             astrCC[i] = "CC" + (i + 1);

  520.         return org.drip.product.creator.CDSBasketBuilder.MakeCDX (cdxrdb._dtMaturity.subtractTenor
  521.             (cdxrdb._iIndexLifeSpan + "Y"), cdxrdb._dtMaturity, cdxrdb._dblCoupon, cdxrdb._strCurrency,
  522.                 astrCC, cdxrdb._strIndexClass + "." + cdxrdb._strIndexGroupName + "." +
  523.                     cdxrdb._iIndexLifeSpan + "Y." + cdxrdb._iIndexSeries + "." + cdxrdb._iIndexVersion);
  524.     }

  525.     private static final org.drip.product.definition.BasketProduct GetPresetOnTheRun (
  526.         final java.lang.String strIndex,
  527.         final org.drip.analytics.date.JulianDate dt,
  528.         final java.lang.String strTenor)
  529.     {
  530.         if (null == dt || null == strIndex || strIndex.isEmpty() || null == strTenor || strTenor.isEmpty())
  531.             return null;

  532.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapFirstCouponSeries =
  533.             _mmIndexFirstCouponSeries.get (strIndex);

  534.         org.drip.analytics.date.JulianDate dtFirstCoupon = dt.nextCreditIMM (3);

  535.         if (null == dtFirstCoupon || null == mapFirstCouponSeries) return null;

  536.         if (null == mapFirstCouponSeries.get (dtFirstCoupon))
  537.             dtFirstCoupon = dtFirstCoupon.nextCreditIMM (3);

  538.         if (null == dtFirstCoupon || null == mapFirstCouponSeries.get (dtFirstCoupon)) return null;

  539.         return MakePresetStandardCDX (strIndex, mapFirstCouponSeries.get (dtFirstCoupon), strTenor);
  540.     }

  541.     private static final org.drip.product.definition.BasketProduct GetPreLoadedOnTheRun (
  542.         final java.lang.String strIndex,
  543.         final org.drip.analytics.date.JulianDate dt,
  544.         final java.lang.String strTenor)
  545.     {
  546.         if (null == dt || null == strIndex || strIndex.isEmpty() || null == strTenor || strTenor.isEmpty())
  547.             return null;

  548.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapFirstCouponSeries =
  549.             org.drip.product.creator.CDXRefDataHolder._mmCDXRDBFirstCouponSeries.get (strIndex);

  550.         org.drip.analytics.date.JulianDate dtFirstCoupon = dt.nextCreditIMM (3);

  551.         if (null == dtFirstCoupon || null == mapFirstCouponSeries) return null;

  552.         if (null == mapFirstCouponSeries.get (dtFirstCoupon))
  553.             dtFirstCoupon = dtFirstCoupon.nextCreditIMM (3);

  554.         if (null == dtFirstCoupon || null == mapFirstCouponSeries.get (dtFirstCoupon)) return null;

  555.         return MakePreLoadedStandardCDX (strIndex, mapFirstCouponSeries.get (dtFirstCoupon), strTenor);
  556.     }

  557.     private static final boolean DumpIndexDetails (
  558.         final java.lang.String strCDXCoverageFile)
  559.     {
  560.         if (null == strCDXCoverageFile || strCDXCoverageFile.isEmpty()) return false;

  561.         java.io.BufferedWriter bw = null;

  562.         try {
  563.             bw = new java.io.BufferedWriter (new java.io.FileWriter (strCDXCoverageFile));

  564.             bw.write ("\n , Index Name, Description, Issue Date, Maturity Date, Frequency, Coupon\n");
  565.         } catch (java.lang.Exception e) {
  566.             e.printStackTrace();

  567.             try {
  568.                 bw.close();
  569.             } catch (java.lang.Exception e1) {
  570.                 e1.printStackTrace();
  571.             }

  572.             return false;
  573.         }

  574.         for (java.util.Map.Entry<java.lang.String, org.drip.product.params.CDXRefDataParams> meCDXRefData :
  575.             org.drip.product.creator.CDXRefDataHolder._mapCDXRefData.entrySet()) {
  576.             org.drip.product.params.CDXRefDataParams cdxrdb = meCDXRefData.getValue();

  577.             if (null == cdxrdb) continue;

  578.             java.lang.String strIndexDetails = " , " + meCDXRefData.getKey() + ", " + cdxrdb._strIndexName +
  579.                 ", " + cdxrdb._dtIssue + ", " + cdxrdb._dtMaturity + ", " + cdxrdb._iFrequency + ", " + (int)
  580.                     (10000. * cdxrdb._dblCoupon) + "\n";

  581.             try {
  582.                 bw.write (strIndexDetails);
  583.             } catch (java.lang.Exception e) {
  584.                 e.printStackTrace();

  585.                 try {
  586.                     bw.close();
  587.                 } catch (java.lang.Exception e1) {
  588.                     e1.printStackTrace();
  589.                 }
  590.             }
  591.         }

  592.         try {
  593.             bw.close();
  594.         } catch (java.lang.Exception e) {
  595.             e.printStackTrace();
  596.         }

  597.         return true;
  598.     }

  599.     /**
  600.      * Create a standard CDX from the index code, the index series, and the tenor.
  601.      *
  602.      * @param strIndex The Index Code (CDX.NA.IG, CDX.NA.HY, etc)
  603.      * @param iSeries Index Series Number
  604.      * @param strTenor The specific tenor - typical common ones are 3Y, 5Y, 7Y, and 10Y
  605.      *
  606.      * @return The CDX Basket Product
  607.      */

  608.     public static final org.drip.product.definition.BasketProduct MakeStandardCDX (
  609.         final java.lang.String strIndex,
  610.         final int iSeries,
  611.         final java.lang.String strTenor)
  612.     {
  613.         org.drip.product.definition.BasketProduct bpCDX = MakePresetStandardCDX (strIndex, iSeries,
  614.             strTenor);

  615.         if (null != bpCDX) return bpCDX;

  616.         return MakePreLoadedStandardCDX (strIndex, iSeries, strTenor);
  617.     }

  618.     /**
  619.      * Retrieve the on-the-run for the index and tenor corresponding to the specified date
  620.      *
  621.      * @param strIndex CDX/ITRAXX index
  622.      * @param dt Specified date
  623.      * @param strTenor Tenor
  624.      *
  625.      * @return CDX/ITRAXX Basket Product
  626.      */

  627.     public static final org.drip.product.definition.BasketProduct GetOnTheRun (
  628.         final java.lang.String strIndex,
  629.         final org.drip.analytics.date.JulianDate dt,
  630.         final java.lang.String strTenor)
  631.     {
  632.         org.drip.product.definition.BasketProduct bpCDX = GetPresetOnTheRun (strIndex, dt, strTenor);

  633.         if (null != bpCDX) return bpCDX;

  634.         return GetPreLoadedOnTheRun (strIndex, dt, strTenor);
  635.     }

  636.     /**
  637.      * Retrieve a set of all the pre-set CDX index names
  638.      *
  639.      * @return Set of the pre-set CDX index names
  640.      */

  641.     public static final java.util.Set<java.lang.String> GetPresetIndexNames()
  642.     {
  643.         return _mmIndexFirstCouponSeries.keySet();
  644.     }

  645.     /**
  646.      * Retrieve a set of all the pre-loaded CDX index names
  647.      *
  648.      * @return Set of the pre-loaded CDX index names
  649.      */

  650.     public static final java.util.Set<java.lang.String> GetPreLoadedIndexNames()
  651.     {
  652.         return org.drip.product.creator.CDXRefDataHolder._mmCDXRDBFirstCouponSeries.keySet();
  653.     }

  654.     /**
  655.      * Retrieve the comprehensive set of pre-set and pre-loaded CDX index names
  656.      *
  657.      * @return Set of the pre-set and the pre-loaded CDX index names
  658.      */

  659.     public static final java.util.Set<java.lang.String> GetCDXNames()
  660.     {
  661.         java.util.Set<java.lang.String> setstrIndex = new java.util.HashSet<java.lang.String>();

  662.         setstrIndex.addAll (GetPreLoadedIndexNames());

  663.         setstrIndex.addAll (GetPresetIndexNames());

  664.         return setstrIndex;
  665.     }

  666.     /**
  667.      * Return the full set of pre-set CDX series/first coupon date pairs for the given CDX
  668.      *
  669.      * @param strCDXName CDX Name
  670.      *
  671.      * @return Map of the CDX series/first coupon dates
  672.      */

  673.     public static final java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer>
  674.         GetPresetCDXSeriesMap (
  675.             final java.lang.String strCDXName)
  676.     {
  677.         if (null == strCDXName || strCDXName.isEmpty()) return null;

  678.         return _mmIndexFirstCouponSeries.get (strCDXName);
  679.     }

  680.     /**
  681.      * Return the full set of pre-loaded CDX series/first coupon date pairs for the given CDX
  682.      *
  683.      * @param strCDXName CDX Name
  684.      *
  685.      * @return Map of the CDX series/first coupon dates
  686.      */

  687.     public static final java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer>
  688.         GetPreLoadedCDXSeriesMap (
  689.             final java.lang.String strCDXName)
  690.     {
  691.         if (null == strCDXName || strCDXName.isEmpty()) return null;

  692.         return org.drip.product.creator.CDXRefDataHolder._mmCDXRDBFirstCouponSeries.get (strCDXName);
  693.     }

  694.     /**
  695.      * Return the full set of CDX series/first coupon date pairs for the given CDX
  696.      *
  697.      * @param strCDXName CDX Name
  698.      *
  699.      * @return Map of the CDX series/first coupon dates
  700.      */

  701.     public static final java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> GetCDXSeriesMap(
  702.         final java.lang.String strCDXName)
  703.     {
  704.         if (null == strCDXName || strCDXName.isEmpty()) return null;

  705.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapFirstCouponSeries = new
  706.             java.util.HashMap<org.drip.analytics.date.JulianDate, java.lang.Integer>();

  707.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapPresetFirstCouponSeries =
  708.             GetPresetCDXSeriesMap (strCDXName);

  709.         if (null != mapPresetFirstCouponSeries) mapFirstCouponSeries.putAll (mapPresetFirstCouponSeries);

  710.         java.util.Map<org.drip.analytics.date.JulianDate, java.lang.Integer> mapPreLoadedFirstCouponSeries =
  711.             GetPreLoadedCDXSeriesMap (strCDXName);

  712.         if (null != mapPreLoadedFirstCouponSeries)
  713.             mapFirstCouponSeries.putAll (mapPreLoadedFirstCouponSeries);

  714.         return mapFirstCouponSeries;
  715.     }

  716.     /**
  717.      * Retrieve the name/description map for all the pre-set CDS indices
  718.      *
  719.      * @return Name/description map for all the pre-set CDS indices
  720.      */

  721.     public static final org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>
  722.         GetPresetCDXDescriptions()
  723.     {
  724.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String> mapCDXDescr = new
  725.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>();

  726.         for (java.util.Map.Entry<java.lang.String, org.drip.product.params.StandardCDXParams> meCDXRefData :
  727.             _mapStandardCDXParams.entrySet())
  728.             mapCDXDescr.put (meCDXRefData.getKey(), meCDXRefData.getKey());

  729.         return mapCDXDescr;
  730.     }

  731.     /**
  732.      * Retrieve the name/description map for all the pre-loaded CDS indices
  733.      *
  734.      * @return Name/description map for all the pre-loaded CDS indices
  735.      */

  736.     public static final org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>
  737.         GetPreLoadedCDXDescriptions()
  738.     {
  739.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String> mapCDXDescr = new
  740.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>();

  741.         for (java.util.Map.Entry<java.lang.String, org.drip.product.params.CDXRefDataParams> meCDXRefData :
  742.             org.drip.product.creator.CDXRefDataHolder._mapCDXRefData.entrySet())
  743.             mapCDXDescr.put (meCDXRefData.getKey(), meCDXRefData.getValue()._strIndexName);

  744.         return mapCDXDescr;
  745.     }

  746.     /**
  747.      * Retrieve the name/description map for all the CDS indices
  748.      *
  749.      * @return Name/description map for all the CDS indices
  750.      */

  751.     public static final org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>
  752.         GetCDXDescriptions()
  753.     {
  754.         org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String> mapCDXDescr = new
  755.             org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.String>();

  756.         mapCDXDescr.putAll (GetPreLoadedCDXDescriptions());

  757.         mapCDXDescr.putAll (GetPresetCDXDescriptions());

  758.         return mapCDXDescr;
  759.     }

  760.     public static final void main (
  761.         final java.lang.String[] astrArgs)
  762.         throws java.lang.Exception
  763.     {
  764.         if (!InitStandardCDXSeries()) System.out.println ("Cannot initialize InitStandardCDXSeries!");

  765.         DumpIndexDetails ("C:\\CreditAnalytics\\docs\\CDXCoverage.csv");
  766.     }
  767. }