FuturesOptions.java

  1. package org.drip.market.exchange;

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

  79. /**
  80.  * <i>FuturesOptions</i> contains the details of the exchange-traded Short-Term Futures Options Contracts.
  81.  *
  82.  *  <br><br>
  83.  *  <ul>
  84.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  85.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  86.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/market">Static Market Fields - the Definitions, the OTC/Exchange Traded Products, and Treasury Settings</a></li>
  87.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/market/exchange">Deliverable Swap, STIR, Treasury Futures</a></li>
  88.  *  </ul>
  89.  *
  90.  * @author Lakshmi Krishnamurthy
  91.  */

  92. public class FuturesOptions {
  93.     private java.lang.String _strTradingMode = "";
  94.     private java.lang.String _strFullyQualifiedName = "";
  95.     private
  96.         org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.product.params.LastTradingDateSetting[]>
  97.             _mapLTDS = new
  98.                 org.drip.analytics.support.CaseInsensitiveHashMap<org.drip.product.params.LastTradingDateSetting[]>();

  99.     /**
  100.      * FuturesOptions Constructor
  101.      *
  102.      * @param strFullyQualifiedName Fully Qualified Name
  103.      * @param strTradingMode Trading Mode - PREMIUM | MARGIN
  104.      *
  105.      * @throws java.lang.Exception Thrown if inputs are invalid
  106.      */

  107.     public FuturesOptions (
  108.         final java.lang.String strFullyQualifiedName,
  109.         final java.lang.String strTradingMode)
  110.         throws java.lang.Exception
  111.     {
  112.         if (null == (_strFullyQualifiedName = strFullyQualifiedName) || _strFullyQualifiedName.isEmpty() ||
  113.             null == (_strTradingMode = strTradingMode) || _strTradingMode.isEmpty())
  114.             throw new java.lang.Exception ("FuturesOptions ctr: Invalid Inputs");
  115.     }

  116.     /**
  117.      * Retrieve the Fully Qualified Name
  118.      *
  119.      * @return The Fully Qualified Name
  120.      */

  121.     public java.lang.String fullyQualifiedName()
  122.     {
  123.         return _strFullyQualifiedName;
  124.     }

  125.     /**
  126.      * Retrieve the Trading Mode
  127.      *
  128.      * @return The Trading Mode
  129.      */

  130.     public java.lang.String tradingMode()
  131.     {
  132.         return _strTradingMode;
  133.     }

  134.     /**
  135.      * Add a Named Exchange LTDS Array Map Entry
  136.      *
  137.      * @param strExchange Named Exchange
  138.      * @param aLTDS Array of LTDS
  139.      *
  140.      * @return TRUE - Named Exchange LTDS Array Map Entry successfully added
  141.      */

  142.     public boolean setLDTS (
  143.         final java.lang.String strExchange,
  144.         final org.drip.product.params.LastTradingDateSetting[] aLTDS)
  145.     {
  146.         if (null == strExchange || strExchange.isEmpty() || null == aLTDS || 0 == aLTDS.length) return false;

  147.         _mapLTDS.put (strExchange, aLTDS);

  148.         return true;
  149.     }

  150.     /**
  151.      * Retrieve the LTDS Array corresponding to the Exchange
  152.      *
  153.      * @param strExchange The Exchange
  154.      *
  155.      * @return The LTDS Array
  156.      */

  157.     public org.drip.product.params.LastTradingDateSetting[] ltdsArray (
  158.         final java.lang.String strExchange)
  159.     {
  160.         if (null == strExchange || strExchange.isEmpty() || !_mapLTDS.containsKey (strExchange)) return null;

  161.         return _mapLTDS.get (strExchange);
  162.     }

  163.     /**
  164.      * Retrieve the Set of Traded Exchanges
  165.      *
  166.      * @return The Set of Traded Exchanges
  167.      */

  168.     public java.util.Set<java.lang.String> exchanges()
  169.     {
  170.         return 0 == _mapLTDS.size() ? null : _mapLTDS.keySet();
  171.     }
  172. }