LatentStateVertexContainer.java

  1. package org.drip.exposure.evolver;

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

  75. /**
  76.  * <i>LatentStateVertexContainer</i> holds the Latent State Labels and their corresponding Vertex
  77.  * Realizations. The References are:
  78.  *  
  79.  * <br><br>
  80.  *      <ul>
  81.  *          <li>
  82.  *              Albanese, C., L. Andersen, and, S. Iabichino (2015): The FVA Puzzle: Accounting, Risk
  83.  *                  Management, and Collateral Trading
  84.  *                  https://papers.ssrn.com/sol3/paper.cfm?abstract_id_2517301 <b>eSSRN</b>
  85.  *          </li>
  86.  *          <li>
  87.  *              Burgard, C., and M. Kjaer (2013): Funding Costs, Funding Strategies <i>Risk</i> <b>23
  88.  *                  (12)</b> 82-87
  89.  *          </li>
  90.  *          <li>
  91.  *              Burgard, C., and M. Kjaer (2014): In the Balance <i>Risk</i> <b>24 (11)</b> 72-75
  92.  *          </li>
  93.  *          <li>
  94.  *              Burgard, C., and M. Kjaer (2014): PDE Representations of Derivatives with Bilateral Counter-
  95.  *                  party Risk and Funding Costs <i>Journal of Credit Risk</i> <b>7 (3)</b> 1-19
  96.  *          </li>
  97.  *          <li>
  98.  *              Piterbarg, V. (2010): Funding Beyond Discounting: Collateral Agreements and Derivatives
  99.  *                  Pricing <i>Risk</i> <b>21 (2)</b> 97-102
  100.  *          </li>
  101.  *          <li>
  102.  *      </ul>
  103.  *
  104.  *  <br><br>
  105.  *  <ul>
  106.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  107.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ExposureAnalyticsLibrary.md">Exposure Analytics</a></li>
  108.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/README.md">Exposure Group Level Collateralized/Uncollateralized Exposure</a></li>
  109.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/exposure/evolver/README.md">Securities and Exposure States Evolvers</a></li>
  110.  *  </ul>
  111.  *
  112.  * @author Lakshmi Krishnamurthy
  113.  */

  114. public class LatentStateVertexContainer
  115. {
  116.     private java.util.Map<java.lang.String, java.lang.Double> _fx = null;
  117.     private java.util.Map<java.lang.String, java.lang.Double> _csa = null;
  118.     private java.util.Map<java.lang.String, java.lang.Double> _repo = null;
  119.     private java.util.Map<java.lang.String, java.lang.Double> _custom = null;
  120.     private java.util.Map<java.lang.String, java.lang.Double> _govvie = null;
  121.     private java.util.Map<java.lang.String, java.lang.Double> _rating = null;
  122.     private java.util.Map<java.lang.String, java.lang.Double> _forward = null;
  123.     private java.util.Map<java.lang.String, java.lang.Double> _funding = null;
  124.     private java.util.Map<java.lang.String, java.lang.Double> _payDown = null;
  125.     private java.util.Map<java.lang.String, java.lang.Double> _overnight = null;
  126.     private java.util.Map<java.lang.String, java.lang.Double> _collateral = null;
  127.     private java.util.Map<java.lang.String, java.lang.Double> _volatility = null;
  128.     private java.util.Map<java.lang.String, java.lang.Double> _otcFixFloat = null;
  129.     private java.util.Map<java.lang.String, java.lang.Double> _entityCredit = null;
  130.     private java.util.Map<java.lang.String, java.lang.Double> _entityEquity = null;
  131.     private java.util.Map<java.lang.String, java.lang.Double> _entityHazard = null;
  132.     private java.util.Map<java.lang.String, java.lang.Double> _entityFunding = null;
  133.     private java.util.Map<java.lang.String, java.lang.Double> _entityRecovery = null;

  134.     private java.util.List<org.drip.state.identifier.LatentStateLabel> _loadedLabelList = new
  135.         java.util.ArrayList<org.drip.state.identifier.LatentStateLabel>();

  136.     /**
  137.      * Empty LatentStateVertexContainer Constructor
  138.      */

  139.     public LatentStateVertexContainer()
  140.     {
  141.         _fx = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  142.         _csa = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  143.         _repo = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  144.         _custom = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  145.         _govvie = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  146.         _rating = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  147.         _forward = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  148.         _funding = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  149.         _payDown = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  150.         _overnight = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  151.         _collateral = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  152.         _volatility = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  153.         _otcFixFloat = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  154.         _entityCredit = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  155.         _entityEquity = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  156.         _entityHazard = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  157.         _entityFunding = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();

  158.         _entityRecovery = new org.drip.analytics.support.CaseInsensitiveHashMap<java.lang.Double>();
  159.     }

  160.     /**
  161.      * Retrieve the FX Latent State Node Container
  162.      *
  163.      * @return The FX Latent State Node Container
  164.      */

  165.     public java.util.Map<java.lang.String, java.lang.Double> fx()
  166.     {
  167.         return _fx;
  168.     }

  169.     /**
  170.      * Retrieve the CSA Latent State Node Container
  171.      *
  172.      * @return The CSA Latent State Node Container
  173.      */

  174.     public java.util.Map<java.lang.String, java.lang.Double> csa()
  175.     {
  176.         return _csa;
  177.     }

  178.     /**
  179.      * Retrieve the Repo Latent State Node Container
  180.      *
  181.      * @return The Repo Latent State Node Container
  182.      */

  183.     public java.util.Map<java.lang.String, java.lang.Double> repo()
  184.     {
  185.         return _repo;
  186.     }

  187.     /**
  188.      * Retrieve the Custom Latent State Node Container
  189.      *
  190.      * @return The Custom Latent State Node Container
  191.      */

  192.     public java.util.Map<java.lang.String, java.lang.Double> custom()
  193.     {
  194.         return _custom;
  195.     }

  196.     /**
  197.      * Retrieve the Govvie Latent State Node Container
  198.      *
  199.      * @return The Govvie Latent State Node Container
  200.      */

  201.     public java.util.Map<java.lang.String, java.lang.Double> govvie()
  202.     {
  203.         return _govvie;
  204.     }

  205.     /**
  206.      * Retrieve the Govvie Latent State Node Container
  207.      *
  208.      * @return The Govvie Latent State Node Container
  209.      */

  210.     public java.util.Map<java.lang.String, java.lang.Double> rating()
  211.     {
  212.         return _rating;
  213.     }

  214.     /**
  215.      * Retrieve the Forward Latent State Node Container
  216.      *
  217.      * @return The Forward Latent State Node Container
  218.      */

  219.     public java.util.Map<java.lang.String, java.lang.Double> forward()
  220.     {
  221.         return _forward;
  222.     }

  223.     /**
  224.      * Retrieve the Funding Latent State Node Container
  225.      *
  226.      * @return The Funding Latent State Node Container
  227.      */

  228.     public java.util.Map<java.lang.String, java.lang.Double> funding()
  229.     {
  230.         return _funding;
  231.     }

  232.     /**
  233.      * Retrieve the Pay Down Latent State Node Container
  234.      *
  235.      * @return The Pay Down Latent State Node Container
  236.      */

  237.     public java.util.Map<java.lang.String, java.lang.Double> payDown()
  238.     {
  239.         return _payDown;
  240.     }

  241.     /**
  242.      * Retrieve the Overnight Latent State Node Container
  243.      *
  244.      * @return The Overnight Latent State Node Container
  245.      */

  246.     public java.util.Map<java.lang.String, java.lang.Double> overnight()
  247.     {
  248.         return _overnight;
  249.     }

  250.     /**
  251.      * Retrieve the Collateral Latent State Node Container
  252.      *
  253.      * @return The Collateral Latent State Node Container
  254.      */

  255.     public java.util.Map<java.lang.String, java.lang.Double> collateral()
  256.     {
  257.         return _collateral;
  258.     }

  259.     /**
  260.      * Retrieve the Volatility Latent State Node Container
  261.      *
  262.      * @return The Volatility Latent State Node Container
  263.      */

  264.     public java.util.Map<java.lang.String, java.lang.Double> volatility()
  265.     {
  266.         return _volatility;
  267.     }

  268.     /**
  269.      * Retrieve the OTC Fix Float Latent State Node Container
  270.      *
  271.      * @return The OTC Fix Float Latent State Node Container
  272.      */

  273.     public java.util.Map<java.lang.String, java.lang.Double> otcFixFloat()
  274.     {
  275.         return _otcFixFloat;
  276.     }

  277.     /**
  278.      * Retrieve the Entity Credit Latent State Node Container
  279.      *
  280.      * @return The Entity Credit Latent State Node Container
  281.      */

  282.     public java.util.Map<java.lang.String, java.lang.Double> entityCredit()
  283.     {
  284.         return _entityCredit;
  285.     }

  286.     /**
  287.      * Retrieve the Entity Equity Latent State Node Container
  288.      *
  289.      * @return The Entity Equity Latent State Node Container
  290.      */

  291.     public java.util.Map<java.lang.String, java.lang.Double> entityEquity()
  292.     {
  293.         return _entityEquity;
  294.     }

  295.     /**
  296.      * Retrieve the Entity Hazard Latent State Node Container
  297.      *
  298.      * @return The Entity Hazard Latent State Node Container
  299.      */

  300.     public java.util.Map<java.lang.String, java.lang.Double> entityHazard()
  301.     {
  302.         return _entityHazard;
  303.     }

  304.     /**
  305.      * Retrieve the Entity Funding Latent State Node Container
  306.      *
  307.      * @return The Entity Funding Latent State Node Container
  308.      */

  309.     public java.util.Map<java.lang.String, java.lang.Double> entityFunding()
  310.     {
  311.         return _entityFunding;
  312.     }

  313.     /**
  314.      * Retrieve the Entity Recovery Latent State Node Container
  315.      *
  316.      * @return The Entity Recovery Latent State Node Container
  317.      */

  318.     public java.util.Map<java.lang.String, java.lang.Double> entityRecovery()
  319.     {
  320.         return _entityRecovery;
  321.     }

  322.     /**
  323.      * Add the Labeled CSA
  324.      *
  325.      * @param csaLabel The CSA Label
  326.      * @param csa The CSA
  327.      *
  328.      * @return The Labeled CSA successfully added
  329.      */

  330.     public boolean add (
  331.         final org.drip.state.identifier.CSALabel csaLabel,
  332.         final double csa)
  333.     {
  334.         if (null == csaLabel || !org.drip.numerical.common.NumberUtil.IsValid (csa))
  335.         {
  336.             return false;
  337.         }

  338.         _csa.put (
  339.             csaLabel.fullyQualifiedName(),
  340.             csa
  341.         );

  342.         _loadedLabelList.add (csaLabel);

  343.         return true;
  344.     }

  345.     /**
  346.      * Check Presence of Labeled CSA
  347.      *
  348.      * @param csaLabel The CSA Label
  349.      *
  350.      * @return The Labeled CSA exists
  351.      */

  352.     public boolean exists (
  353.         final org.drip.state.identifier.CSALabel csaLabel)
  354.     {
  355.         return null != csaLabel && _csa.containsKey (csaLabel.fullyQualifiedName());
  356.     }

  357.     /**
  358.      * Retrieve of Labeled CSA
  359.      *
  360.      * @param csaLabel The CSA Label
  361.      *
  362.      * @return The Labeled CSA
  363.      *
  364.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  365.      */

  366.     public double csa (
  367.         final org.drip.state.identifier.CSALabel csaLabel)
  368.         throws java.lang.Exception
  369.     {
  370.         if (!exists (csaLabel))
  371.         {
  372.             throw new java.lang.Exception ("LatentStateNodeContainer::csa => Invalid Inputs");
  373.         }

  374.         return _csa.get (csaLabel.fullyQualifiedName());
  375.     }

  376.     /**
  377.      * Add the Labeled FX
  378.      *
  379.      * @param fxLabel The FX Label
  380.      * @param fx The FX
  381.      *
  382.      * @return The Labeled FX successfully added
  383.      */

  384.     public boolean add (
  385.         final org.drip.state.identifier.FXLabel fxLabel,
  386.         final double fx)
  387.     {
  388.         if (null == fxLabel || !org.drip.numerical.common.NumberUtil.IsValid (fx))
  389.         {
  390.             return false;
  391.         }

  392.         _fx.put (
  393.             fxLabel.fullyQualifiedName(),
  394.             fx
  395.         );

  396.         _loadedLabelList.add (fxLabel);

  397.         return true;
  398.     }

  399.     /**
  400.      * Check Presence of Labeled FX
  401.      *
  402.      * @param fxLabel The FX Label
  403.      *
  404.      * @return The Labeled FX exists
  405.      */

  406.     public boolean exists (
  407.         final org.drip.state.identifier.FXLabel fxLabel)
  408.     {
  409.         return null != fxLabel && _fx.containsKey (fxLabel.fullyQualifiedName());
  410.     }

  411.     /**
  412.      * Retrieve of Labeled FX
  413.      *
  414.      * @param fxLabel The FX Label
  415.      *
  416.      * @return The Labeled FX
  417.      *
  418.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  419.      */

  420.     public double fx (
  421.         final org.drip.state.identifier.FXLabel fxLabel)
  422.         throws java.lang.Exception
  423.     {
  424.         if (!exists (fxLabel))
  425.         {
  426.             throw new java.lang.Exception ("LatentStateNodeContainer::fx => Invalid Inputs");
  427.         }

  428.         return _fx.get (fxLabel.fullyQualifiedName());
  429.     }

  430.     /**
  431.      * Add the Labeled Repo
  432.      *
  433.      * @param repoLabel The Repo Label
  434.      * @param repo The Repo
  435.      *
  436.      * @return The Labeled Repo successfully added
  437.      */

  438.     public boolean add (
  439.         final org.drip.state.identifier.RepoLabel repoLabel,
  440.         final double repo)
  441.     {
  442.         if (null == repoLabel || !org.drip.numerical.common.NumberUtil.IsValid (repo))
  443.         {
  444.             return false;
  445.         }

  446.         _repo.put (
  447.             repoLabel.fullyQualifiedName(),
  448.             repo
  449.         );

  450.         _loadedLabelList.add (repoLabel);

  451.         return true;
  452.     }

  453.     /**
  454.      * Check Presence of Labeled Repo
  455.      *
  456.      * @param repoLabel The Repo Label
  457.      *
  458.      * @return The Labeled Repo exists
  459.      */

  460.     public boolean exists (
  461.         final org.drip.state.identifier.RepoLabel repoLabel)
  462.     {
  463.         return null != repoLabel && _repo.containsKey (repoLabel.fullyQualifiedName());
  464.     }

  465.     /**
  466.      * Retrieve of Labeled Repo
  467.      *
  468.      * @param repoLabel The Repo Label
  469.      *
  470.      * @return The Labeled Repo
  471.      *
  472.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  473.      */

  474.     public double repo (
  475.         final org.drip.state.identifier.RepoLabel repoLabel)
  476.         throws java.lang.Exception
  477.     {
  478.         if (!exists (repoLabel))
  479.         {
  480.             throw new java.lang.Exception ("LatentStateNodeContainer::repo => Invalid Inputs");
  481.         }

  482.         return _repo.get (repoLabel.fullyQualifiedName());
  483.     }

  484.     /**
  485.      * Add the Labeled Custom
  486.      *
  487.      * @param customLabel The Custom Label
  488.      * @param custom The Custom
  489.      *
  490.      * @return The Labeled Custom successfully added
  491.      */

  492.     public boolean add (
  493.         final org.drip.state.identifier.CustomLabel customLabel,
  494.         final double custom)
  495.     {
  496.         if (null == customLabel || !org.drip.numerical.common.NumberUtil.IsValid (custom))
  497.         {
  498.             return false;
  499.         }

  500.         _custom.put (
  501.             customLabel.fullyQualifiedName(),
  502.             custom
  503.         );

  504.         _loadedLabelList.add (customLabel);

  505.         return true;
  506.     }

  507.     /**
  508.      * Check Presence of Labeled Custom
  509.      *
  510.      * @param customLabel The Custom Label
  511.      *
  512.      * @return The Labeled Custom exists
  513.      */

  514.     public boolean exists (
  515.         final org.drip.state.identifier.CustomLabel customLabel)
  516.     {
  517.         return null != customLabel && _custom.containsKey (customLabel.fullyQualifiedName());
  518.     }

  519.     /**
  520.      * Retrieve of Labeled Custom
  521.      *
  522.      * @param customLabel The Custom Label
  523.      *
  524.      * @return The Labeled Custom
  525.      *
  526.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  527.      */

  528.     public double custom (
  529.         final org.drip.state.identifier.CustomLabel customLabel)
  530.         throws java.lang.Exception
  531.     {
  532.         if (!exists (customLabel))
  533.         {
  534.             throw new java.lang.Exception ("LatentStateNodeContainer::custom => Invalid Inputs");
  535.         }

  536.         return _custom.get (customLabel.fullyQualifiedName());
  537.     }

  538.     /**
  539.      * Add the Labeled Govvie
  540.      *
  541.      * @param govvieLabel The Govvie Label
  542.      * @param govvie The Govvie
  543.      *
  544.      * @return The Labeled Govvie successfully added
  545.      */

  546.     public boolean add (
  547.         final org.drip.state.identifier.GovvieLabel govvieLabel,
  548.         final double govvie)
  549.     {
  550.         if (null == govvieLabel || !org.drip.numerical.common.NumberUtil.IsValid (govvie))
  551.         {
  552.             return false;
  553.         }

  554.         _govvie.put (
  555.             govvieLabel.fullyQualifiedName(),
  556.             govvie
  557.         );

  558.         _loadedLabelList.add (govvieLabel);

  559.         return true;
  560.     }

  561.     /**
  562.      * Check Presence of Labeled Govvie
  563.      *
  564.      * @param govvieLabel The Govvie Label
  565.      *
  566.      * @return The Labeled Govvie exists
  567.      */

  568.     public boolean exists (
  569.         final org.drip.state.identifier.GovvieLabel govvieLabel)
  570.     {
  571.         return null != govvieLabel && _govvie.containsKey (govvieLabel.fullyQualifiedName());
  572.     }

  573.     /**
  574.      * Retrieve of Labeled Govvie
  575.      *
  576.      * @param govvieLabel The Govvie Label
  577.      *
  578.      * @return The Labeled Govvie
  579.      *
  580.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  581.      */

  582.     public double govvie (
  583.         final org.drip.state.identifier.GovvieLabel govvieLabel)
  584.         throws java.lang.Exception
  585.     {
  586.         if (!exists (govvieLabel))
  587.         {
  588.             throw new java.lang.Exception ("LatentStateNodeContainer::govvie => Invalid Inputs");
  589.         }

  590.         return _govvie.get (govvieLabel.fullyQualifiedName());
  591.     }

  592.     /**
  593.      * Add the Labeled Rating
  594.      *
  595.      * @param ratingLabel The Rating Label
  596.      * @param rating The Rating
  597.      *
  598.      * @return The Labeled Rating successfully added
  599.      */

  600.     public boolean add (
  601.         final org.drip.state.identifier.RatingLabel ratingLabel,
  602.         final double rating)
  603.     {
  604.         if (null == ratingLabel || !org.drip.numerical.common.NumberUtil.IsValid (rating))
  605.         {
  606.             return false;
  607.         }

  608.         _rating.put (
  609.             ratingLabel.fullyQualifiedName(),
  610.             rating
  611.         );

  612.         _loadedLabelList.add (ratingLabel);

  613.         return true;
  614.     }

  615.     /**
  616.      * Check Presence of Labeled Rating
  617.      *
  618.      * @param ratingLabel The Rating Label
  619.      *
  620.      * @return The Labeled Rating exists
  621.      */

  622.     public boolean exists (
  623.         final org.drip.state.identifier.RatingLabel ratingLabel)
  624.     {
  625.         return null != ratingLabel && _rating.containsKey (ratingLabel.fullyQualifiedName());
  626.     }

  627.     /**
  628.      * Retrieve of Labeled Rating
  629.      *
  630.      * @param ratingLabel The Rating Label
  631.      *
  632.      * @return The Labeled Rating
  633.      *
  634.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  635.      */

  636.     public double rating (
  637.         final org.drip.state.identifier.RatingLabel ratingLabel)
  638.         throws java.lang.Exception
  639.     {
  640.         if (!exists (ratingLabel))
  641.         {
  642.             throw new java.lang.Exception ("LatentStateNodeContainer::rating => Invalid Inputs");
  643.         }

  644.         return _rating.get (ratingLabel.fullyQualifiedName());
  645.     }

  646.     /**
  647.      * Add the Labeled Forward
  648.      *
  649.      * @param forwardLabel The Forward Label
  650.      * @param forward The Forward
  651.      *
  652.      * @return The Labeled Forward successfully added
  653.      */

  654.     public boolean add (
  655.         final org.drip.state.identifier.ForwardLabel forwardLabel,
  656.         final double forward)
  657.     {
  658.         if (null == forwardLabel || !org.drip.numerical.common.NumberUtil.IsValid (forward))
  659.         {
  660.             return false;
  661.         }

  662.         _forward.put (
  663.             forwardLabel.fullyQualifiedName(),
  664.             forward
  665.         );

  666.         _loadedLabelList.add (forwardLabel);

  667.         return true;
  668.     }

  669.     /**
  670.      * Check Presence of Labeled Forward
  671.      *
  672.      * @param forwardLabel The Forward Label
  673.      *
  674.      * @return The Labeled Forward exists
  675.      */

  676.     public boolean exists (
  677.         final org.drip.state.identifier.ForwardLabel forwardLabel)
  678.     {
  679.         return null != forwardLabel && _forward.containsKey (forwardLabel.fullyQualifiedName());
  680.     }

  681.     /**
  682.      * Retrieve of Labeled Forward
  683.      *
  684.      * @param forwardLabel The Forward Label
  685.      *
  686.      * @return The Labeled Forward
  687.      *
  688.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  689.      */

  690.     public double forward (
  691.         final org.drip.state.identifier.ForwardLabel forwardLabel)
  692.         throws java.lang.Exception
  693.     {
  694.         if (!exists (forwardLabel))
  695.         {
  696.             throw new java.lang.Exception ("LatentStateNodeContainer::forward => Invalid Inputs");
  697.         }

  698.         return _forward.get (forwardLabel.fullyQualifiedName());
  699.     }

  700.     /**
  701.      * Add the Labeled Funding
  702.      *
  703.      * @param fundingLabel The Funding Label
  704.      * @param funding The Funding
  705.      *
  706.      * @return The Labeled Funding successfully added
  707.      */

  708.     public boolean add (
  709.         final org.drip.state.identifier.FundingLabel fundingLabel,
  710.         final double funding)
  711.     {
  712.         if (null == fundingLabel || !org.drip.numerical.common.NumberUtil.IsValid (funding))
  713.         {
  714.             return false;
  715.         }

  716.         _funding.put (
  717.             fundingLabel.fullyQualifiedName(),
  718.             funding
  719.         );

  720.         _loadedLabelList.add (fundingLabel);

  721.         return true;
  722.     }

  723.     /**
  724.      * Check Presence of Labeled Funding
  725.      *
  726.      * @param fundingLabel The Funding Label
  727.      *
  728.      * @return The Labeled Funding exists
  729.      */

  730.     public boolean exists (
  731.         final org.drip.state.identifier.FundingLabel fundingLabel)
  732.     {
  733.         return null != fundingLabel && _funding.containsKey (fundingLabel.fullyQualifiedName());
  734.     }

  735.     /**
  736.      * Retrieve of Labeled Funding
  737.      *
  738.      * @param fundingLabel The Funding Label
  739.      *
  740.      * @return The Labeled Funding
  741.      *
  742.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  743.      */

  744.     public double funding (
  745.         final org.drip.state.identifier.FundingLabel fundingLabel)
  746.         throws java.lang.Exception
  747.     {
  748.         if (!exists (fundingLabel))
  749.         {
  750.             throw new java.lang.Exception ("LatentStateNodeContainer::funding => Invalid Inputs");
  751.         }

  752.         return _funding.get (fundingLabel.fullyQualifiedName());
  753.     }

  754.     /**
  755.      * Add the Labeled Pay Down
  756.      *
  757.      * @param payDownLabel The Pay Down Label
  758.      * @param payDown The Pay Down
  759.      *
  760.      * @return The Labeled Pay Down successfully added
  761.      */

  762.     public boolean add (
  763.         final org.drip.state.identifier.PaydownLabel payDownLabel,
  764.         final double payDown)
  765.     {
  766.         if (null == payDownLabel || !org.drip.numerical.common.NumberUtil.IsValid (payDown))
  767.         {
  768.             return false;
  769.         }

  770.         _payDown.put (
  771.             payDownLabel.fullyQualifiedName(),
  772.             payDown
  773.         );

  774.         _loadedLabelList.add (payDownLabel);

  775.         return true;
  776.     }

  777.     /**
  778.      * Check Presence of Labeled Pay Down
  779.      *
  780.      * @param payDownLabel The Pay Down Label
  781.      *
  782.      * @return The Labeled Pay Down exists
  783.      */

  784.     public boolean exists (
  785.         final org.drip.state.identifier.PaydownLabel payDownLabel)
  786.     {
  787.         return null != payDownLabel && _payDown.containsKey (payDownLabel.fullyQualifiedName());
  788.     }

  789.     /**
  790.      * Retrieve of Labeled Pay Down
  791.      *
  792.      * @param payDownLabel The Pay Down Label
  793.      *
  794.      * @return The Labeled Pay Down
  795.      *
  796.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  797.      */

  798.     public double payDown (
  799.         final org.drip.state.identifier.PaydownLabel payDownLabel)
  800.         throws java.lang.Exception
  801.     {
  802.         if (!exists (payDownLabel))
  803.         {
  804.             throw new java.lang.Exception ("LatentStateNodeContainer::payDown => Invalid Inputs");
  805.         }

  806.         return _payDown.get (payDownLabel.fullyQualifiedName());
  807.     }

  808.     /**
  809.      * Add the Labeled Overnight
  810.      *
  811.      * @param overnightLabel The Overnight Label
  812.      * @param overnight The Overnight
  813.      *
  814.      * @return The Labeled Overnight successfully added
  815.      */

  816.     public boolean add (
  817.         final org.drip.state.identifier.OvernightLabel overnightLabel,
  818.         final double overnight)
  819.     {
  820.         if (null == overnightLabel || !org.drip.numerical.common.NumberUtil.IsValid (overnight))
  821.         {
  822.             return false;
  823.         }

  824.         _overnight.put (
  825.             overnightLabel.fullyQualifiedName(),
  826.             overnight
  827.         );

  828.         _loadedLabelList.add (overnightLabel);

  829.         return true;
  830.     }

  831.     /**
  832.      * Check Presence of Labeled Overnight
  833.      *
  834.      * @param overnightLabel The Overnight Label
  835.      *
  836.      * @return The Labeled Overnight exists
  837.      */

  838.     public boolean exists (
  839.         final org.drip.state.identifier.OvernightLabel overnightLabel)
  840.     {
  841.         return null != overnightLabel && _overnight.containsKey (overnightLabel.fullyQualifiedName());
  842.     }

  843.     /**
  844.      * Retrieve of Labeled Overnight
  845.      *
  846.      * @param overnightLabel The Overnight Label
  847.      *
  848.      * @return The Labeled Overnight
  849.      *
  850.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  851.      */

  852.     public double overnight (
  853.         final org.drip.state.identifier.OvernightLabel overnightLabel)
  854.         throws java.lang.Exception
  855.     {
  856.         if (!exists (overnightLabel))
  857.         {
  858.             throw new java.lang.Exception ("LatentStateNodeContainer::overnight => Invalid Inputs");
  859.         }

  860.         return _overnight.get (overnightLabel.fullyQualifiedName());
  861.     }

  862.     /**
  863.      * Add the Labeled Collateral
  864.      *
  865.      * @param collateralLabel The Collateral Label
  866.      * @param collateral The Collateral
  867.      *
  868.      * @return The Labeled Collateral successfully added
  869.      */

  870.     public boolean add (
  871.         final org.drip.state.identifier.CollateralLabel collateralLabel,
  872.         final double collateral)
  873.     {
  874.         if (null == collateralLabel || !org.drip.numerical.common.NumberUtil.IsValid (collateral))
  875.         {
  876.             return false;
  877.         }

  878.         _collateral.put (
  879.             collateralLabel.fullyQualifiedName(),
  880.             collateral
  881.         );

  882.         _loadedLabelList.add (collateralLabel);

  883.         return true;
  884.     }

  885.     /**
  886.      * Check Presence of Labeled Collateral
  887.      *
  888.      * @param collateralLabel The Collateral Label
  889.      *
  890.      * @return The Labeled Collateral exists
  891.      */

  892.     public boolean exists (
  893.         final org.drip.state.identifier.CollateralLabel collateralLabel)
  894.     {
  895.         return null != collateralLabel && _collateral.containsKey (collateralLabel.fullyQualifiedName());
  896.     }

  897.     /**
  898.      * Retrieve of Labeled Collateral
  899.      *
  900.      * @param collateralLabel The Collateral Label
  901.      *
  902.      * @return The Labeled Collateral
  903.      *
  904.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  905.      */

  906.     public double collateral (
  907.         final org.drip.state.identifier.CollateralLabel collateralLabel)
  908.         throws java.lang.Exception
  909.     {
  910.         if (!exists (collateralLabel))
  911.         {
  912.             throw new java.lang.Exception ("LatentStateNodeContainer::collateral => Invalid Inputs");
  913.         }

  914.         return _collateral.get (collateralLabel.fullyQualifiedName());
  915.     }

  916.     /**
  917.      * Add the Labeled Volatility
  918.      *
  919.      * @param volatilityLabel The Volatility Label
  920.      * @param volatility The Volatility
  921.      *
  922.      * @return The Labeled Volatility successfully added
  923.      */

  924.     public boolean add (
  925.         final org.drip.state.identifier.VolatilityLabel volatilityLabel,
  926.         final double volatility)
  927.     {
  928.         if (null == volatilityLabel || !org.drip.numerical.common.NumberUtil.IsValid (volatility))
  929.         {
  930.             return false;
  931.         }

  932.         _volatility.put (
  933.             volatilityLabel.fullyQualifiedName(),
  934.             volatility
  935.         );

  936.         _loadedLabelList.add (volatilityLabel);

  937.         return true;
  938.     }

  939.     /**
  940.      * Check Presence of Labeled Volatility
  941.      *
  942.      * @param volatilityLabel The Volatility Label
  943.      *
  944.      * @return The Labeled Volatility exists
  945.      */

  946.     public boolean exists (
  947.         final org.drip.state.identifier.VolatilityLabel volatilityLabel)
  948.     {
  949.         return null != volatilityLabel && _volatility.containsKey (volatilityLabel.fullyQualifiedName());
  950.     }

  951.     /**
  952.      * Retrieve of Labeled Volatility
  953.      *
  954.      * @param volatilityLabel The Volatility Label
  955.      *
  956.      * @return The Labeled Volatility
  957.      *
  958.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  959.      */

  960.     public double volatility (
  961.         final org.drip.state.identifier.VolatilityLabel volatilityLabel)
  962.         throws java.lang.Exception
  963.     {
  964.         if (!exists (volatilityLabel))
  965.         {
  966.             throw new java.lang.Exception ("LatentStateNodeContainer::volatility => Invalid Inputs");
  967.         }

  968.         return _volatility.get (volatilityLabel.fullyQualifiedName());
  969.     }

  970.     /**
  971.      * Add the Labeled OTC Fix Float
  972.      *
  973.      * @param otcFixFloatLabel The OTC Fix Float Label
  974.      * @param otcFixFloat The OTC Fix Float Value
  975.      *
  976.      * @return The Labeled OTC Fix Float successfully added
  977.      */

  978.     public boolean add (
  979.         final org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel,
  980.         final double otcFixFloat)
  981.     {
  982.         if (null == otcFixFloatLabel || !org.drip.numerical.common.NumberUtil.IsValid (otcFixFloat))
  983.         {
  984.             return false;
  985.         }

  986.         _otcFixFloat.put (
  987.             otcFixFloatLabel.fullyQualifiedName(),
  988.             otcFixFloat
  989.         );

  990.         _loadedLabelList.add (otcFixFloatLabel);

  991.         return true;
  992.     }

  993.     /**
  994.      * Check Presence of Labeled OTC Fix Float
  995.      *
  996.      * @param otcFixFloatLabel The OTC Fix Float Label
  997.      *
  998.      * @return The Labeled OTC Fix Float exists
  999.      */

  1000.     public boolean exists (
  1001.         final org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel)
  1002.     {
  1003.         return null != otcFixFloatLabel && _otcFixFloat.containsKey (otcFixFloatLabel.fullyQualifiedName());
  1004.     }

  1005.     /**
  1006.      * Retrieve of Labeled OTC Fix Float
  1007.      *
  1008.      * @param otcFixFloatLabel The OTC Fix Float Label
  1009.      *
  1010.      * @return The Labeled OTC Fix Float
  1011.      *
  1012.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1013.      */

  1014.     public double otcFixFloat (
  1015.         final org.drip.state.identifier.OTCFixFloatLabel otcFixFloatLabel)
  1016.         throws java.lang.Exception
  1017.     {
  1018.         if (!exists (otcFixFloatLabel))
  1019.         {
  1020.             throw new java.lang.Exception ("LatentStateNodeContainer::otcFixFloat => Invalid Inputs");
  1021.         }

  1022.         return _otcFixFloat.get (otcFixFloatLabel.fullyQualifiedName());
  1023.     }

  1024.     /**
  1025.      * Add the Labeled Entity Credit
  1026.      *
  1027.      * @param entityCreditLabel The Entity Credit Label
  1028.      * @param entityCredit The Entity Credit
  1029.      *
  1030.      * @return The Labeled Entity Credit successfully added
  1031.      */

  1032.     public boolean add (
  1033.         final org.drip.state.identifier.EntityCreditLabel entityCreditLabel,
  1034.         final double entityCredit)
  1035.     {
  1036.         if (null == entityCreditLabel || !org.drip.numerical.common.NumberUtil.IsValid (entityCredit))
  1037.         {
  1038.             return false;
  1039.         }

  1040.         _entityCredit.put (
  1041.             entityCreditLabel.fullyQualifiedName(),
  1042.             entityCredit
  1043.         );

  1044.         _loadedLabelList.add (entityCreditLabel);

  1045.         return true;
  1046.     }

  1047.     /**
  1048.      * Check Presence of Labeled Entity Credit
  1049.      *
  1050.      * @param entityCreditLabel The Entity Credit Label
  1051.      *
  1052.      * @return The Labeled Entity Credit exists
  1053.      */

  1054.     public boolean exists (
  1055.         final org.drip.state.identifier.EntityCreditLabel entityCreditLabel)
  1056.     {
  1057.         return null != entityCreditLabel && _entityCredit.containsKey
  1058.             (entityCreditLabel.fullyQualifiedName());
  1059.     }

  1060.     /**
  1061.      * Retrieve of Labeled Entity Credit
  1062.      *
  1063.      * @param entityCreditLabel The Entity Credit Label
  1064.      *
  1065.      * @return The Labeled Entity Credit
  1066.      *
  1067.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1068.      */

  1069.     public double entityCredit (
  1070.         final org.drip.state.identifier.EntityCreditLabel entityCreditLabel)
  1071.         throws java.lang.Exception
  1072.     {
  1073.         if (!exists (entityCreditLabel))
  1074.         {
  1075.             throw new java.lang.Exception ("LatentStateNodeContainer::entityCredit => Invalid Inputs");
  1076.         }

  1077.         return _entityCredit.get (entityCreditLabel.fullyQualifiedName());
  1078.     }

  1079.     /**
  1080.      * Add the Labeled Entity Equity
  1081.      *
  1082.      * @param entityEquityLabel The Entity Equity Label
  1083.      * @param entityEquity The Entity Equity
  1084.      *
  1085.      * @return The Labeled Entity Equity successfully added
  1086.      */

  1087.     public boolean add (
  1088.         final org.drip.state.identifier.EntityEquityLabel entityEquityLabel,
  1089.         final double entityEquity)
  1090.     {
  1091.         if (null == entityEquityLabel || !org.drip.numerical.common.NumberUtil.IsValid (entityEquity))
  1092.         {
  1093.             return false;
  1094.         }

  1095.         _entityEquity.put (
  1096.             entityEquityLabel.fullyQualifiedName(),
  1097.             entityEquity
  1098.         );

  1099.         _loadedLabelList.add (entityEquityLabel);

  1100.         return true;
  1101.     }

  1102.     /**
  1103.      * Check Presence of Labeled Entity Equity
  1104.      *
  1105.      * @param entityEquityLabel The Entity Equity Label
  1106.      *
  1107.      * @return The Labeled Entity Equity exists
  1108.      */

  1109.     public boolean exists (
  1110.         final org.drip.state.identifier.EntityEquityLabel entityEquityLabel)
  1111.     {
  1112.         return null != entityEquityLabel && _entityEquity.containsKey
  1113.             (entityEquityLabel.fullyQualifiedName());
  1114.     }

  1115.     /**
  1116.      * Retrieve of Labeled Entity Equity
  1117.      *
  1118.      * @param entityEquityLabel The Entity Equity Label
  1119.      *
  1120.      * @return The Labeled Entity Equity
  1121.      *
  1122.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1123.      */

  1124.     public double entityEquity (
  1125.         final org.drip.state.identifier.EntityEquityLabel entityEquityLabel)
  1126.         throws java.lang.Exception
  1127.     {
  1128.         if (!exists (entityEquityLabel))
  1129.         {
  1130.             throw new java.lang.Exception ("LatentStateNodeContainer::entityEquity => Invalid Inputs");
  1131.         }

  1132.         return _entityEquity.get (entityEquityLabel.fullyQualifiedName());
  1133.     }

  1134.     /**
  1135.      * Add the Labeled Entity Hazard
  1136.      *
  1137.      * @param entityHazardLabel The Entity Hazard Label
  1138.      * @param entityHazard The Entity Hazard
  1139.      *
  1140.      * @return The Labeled Entity Hazard successfully added
  1141.      */

  1142.     public boolean add (
  1143.         final org.drip.state.identifier.EntityHazardLabel entityHazardLabel,
  1144.         final double entityHazard)
  1145.     {
  1146.         if (null == entityHazardLabel || !org.drip.numerical.common.NumberUtil.IsValid (entityHazard))
  1147.         {
  1148.             return false;
  1149.         }

  1150.         _entityHazard.put (
  1151.             entityHazardLabel.fullyQualifiedName(),
  1152.             entityHazard
  1153.         );

  1154.         _loadedLabelList.add (entityHazardLabel);

  1155.         return true;
  1156.     }

  1157.     /**
  1158.      * Check Presence of Labeled Entity Hazard
  1159.      *
  1160.      * @param entityHazardLabel The Entity Hazard Label
  1161.      *
  1162.      * @return The Labeled Entity Hazard exists
  1163.      */

  1164.     public boolean exists (
  1165.         final org.drip.state.identifier.EntityHazardLabel entityHazardLabel)
  1166.     {
  1167.         return null != entityHazardLabel && _entityHazard.containsKey
  1168.             (entityHazardLabel.fullyQualifiedName());
  1169.     }

  1170.     /**
  1171.      * Retrieve of Labeled Entity Hazard
  1172.      *
  1173.      * @param entityHazardLabel The Entity Hazard Label
  1174.      *
  1175.      * @return The Labeled Entity Hazard
  1176.      *
  1177.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1178.      */

  1179.     public double entityHazard (
  1180.         final org.drip.state.identifier.EntityHazardLabel entityHazardLabel)
  1181.         throws java.lang.Exception
  1182.     {
  1183.         if (!exists (entityHazardLabel))
  1184.         {
  1185.             throw new java.lang.Exception ("LatentStateNodeContainer::entityHazard => Invalid Inputs");
  1186.         }

  1187.         return _entityHazard.get (entityHazardLabel.fullyQualifiedName());
  1188.     }

  1189.     /**
  1190.      * Add the Labeled Entity Funding
  1191.      *
  1192.      * @param entityFundingLabel The Entity Funding Label
  1193.      * @param entityFunding The Entity Funding
  1194.      *
  1195.      * @return The Labeled Entity Funding successfully added
  1196.      */

  1197.     public boolean add (
  1198.         final org.drip.state.identifier.EntityFundingLabel entityFundingLabel,
  1199.         final double entityFunding)
  1200.     {
  1201.         if (null == entityFundingLabel || !org.drip.numerical.common.NumberUtil.IsValid (entityFunding))
  1202.         {
  1203.             return false;
  1204.         }

  1205.         _entityFunding.put (
  1206.             entityFundingLabel.fullyQualifiedName(),
  1207.             entityFunding
  1208.         );

  1209.         _loadedLabelList.add (entityFundingLabel);

  1210.         return true;
  1211.     }

  1212.     /**
  1213.      * Check Presence of Labeled Entity Funding
  1214.      *
  1215.      * @param entityFundingLabel The Entity Funding Label
  1216.      *
  1217.      * @return The Labeled Entity Funding Exists
  1218.      */

  1219.     public boolean exists (
  1220.         final org.drip.state.identifier.EntityFundingLabel entityFundingLabel)
  1221.     {
  1222.         return null != entityFundingLabel && _entityFunding.containsKey
  1223.             (entityFundingLabel.fullyQualifiedName());
  1224.     }

  1225.     /**
  1226.      * Retrieve of Labeled Entity Funding
  1227.      *
  1228.      * @param entityFundingLabel The Entity Funding Label
  1229.      *
  1230.      * @return The Labeled Entity Funding
  1231.      *
  1232.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1233.      */

  1234.     public double entityFunding (
  1235.         final org.drip.state.identifier.EntityFundingLabel entityFundingLabel)
  1236.         throws java.lang.Exception
  1237.     {
  1238.         if (!exists (entityFundingLabel))
  1239.         {
  1240.             throw new java.lang.Exception ("LatentStateNodeContainer::entityFunding => Invalid Inputs");
  1241.         }

  1242.         return _entityFunding.get (entityFundingLabel.fullyQualifiedName());
  1243.     }

  1244.     /**
  1245.      * Add the Labeled Entity Recovery
  1246.      *
  1247.      * @param entityRecoveryLabel The Entity Recovery Label
  1248.      * @param entityRecovery The Entity Recovery
  1249.      *
  1250.      * @return The Labeled Entity Recovery successfully added
  1251.      */

  1252.     public boolean add (
  1253.         final org.drip.state.identifier.EntityRecoveryLabel entityRecoveryLabel,
  1254.         final double entityRecovery)
  1255.     {
  1256.         if (null == entityRecoveryLabel || !org.drip.numerical.common.NumberUtil.IsValid (entityRecovery))
  1257.         {
  1258.             return false;
  1259.         }

  1260.         _entityRecovery.put (
  1261.             entityRecoveryLabel.fullyQualifiedName(),
  1262.             entityRecovery
  1263.         );

  1264.         _loadedLabelList.add (entityRecoveryLabel);

  1265.         return true;
  1266.     }

  1267.     /**
  1268.      * Check Presence of Labeled Entity Recovery
  1269.      *
  1270.      * @param entityRecoveryLabel The Entity Recovery Label
  1271.      *
  1272.      * @return The Labeled Entity Recovery exists
  1273.      */

  1274.     public boolean exists (
  1275.         final org.drip.state.identifier.EntityRecoveryLabel entityRecoveryLabel)
  1276.     {
  1277.         return null != entityRecoveryLabel && _entityRecovery.containsKey
  1278.             (entityRecoveryLabel.fullyQualifiedName());
  1279.     }

  1280.     /**
  1281.      * Retrieve of Labeled Entity Recovery
  1282.      *
  1283.      * @param entityRecoveryLabel The Entity Recovery Label
  1284.      *
  1285.      * @return The Labeled Entity Recovery
  1286.      *
  1287.      * @throws java.lang.Exception Thrown if Inputs are Invalid
  1288.      */

  1289.     public double entityRecovery (
  1290.         final org.drip.state.identifier.EntityRecoveryLabel entityRecoveryLabel)
  1291.         throws java.lang.Exception
  1292.     {
  1293.         if (!exists (entityRecoveryLabel))
  1294.         {
  1295.             throw new java.lang.Exception ("LatentStateNodeContainer::entityRecovery => Invalid Inputs");
  1296.         }

  1297.         return _entityRecovery.get (entityRecoveryLabel.fullyQualifiedName());
  1298.     }

  1299.     /**
  1300.      * Add the Value Corresponding to the Specific Latent State
  1301.      *
  1302.      * @param latentStateLabel The Latent State Label
  1303.      * @param value The Latent State Value
  1304.      *
  1305.      * @return TRUE - The Value Corresponding to the Specific Latent State successfully added
  1306.      */

  1307.     public boolean addLatentStateValue (
  1308.         final org.drip.state.identifier.LatentStateLabel latentStateLabel,
  1309.         final double value)
  1310.     {
  1311.         if (null == latentStateLabel || !org.drip.numerical.common.NumberUtil.IsValid (value))
  1312.         {
  1313.             return false;
  1314.         }

  1315.         if (latentStateLabel instanceof org.drip.state.identifier.FXLabel)
  1316.         {
  1317.             return add (
  1318.                 (org.drip.state.identifier.FXLabel) latentStateLabel,
  1319.                 value
  1320.             );
  1321.         }

  1322.         if (latentStateLabel instanceof org.drip.state.identifier.CSALabel)
  1323.         {
  1324.             return add (
  1325.                 (org.drip.state.identifier.CSALabel) latentStateLabel,
  1326.                 value
  1327.             );
  1328.         }

  1329.         if (latentStateLabel instanceof org.drip.state.identifier.RepoLabel)
  1330.         {
  1331.             return add (
  1332.                 (org.drip.state.identifier.RepoLabel) latentStateLabel,
  1333.                 value
  1334.             );
  1335.         }

  1336.         if (latentStateLabel instanceof org.drip.state.identifier.CustomLabel)
  1337.         {
  1338.             return add (
  1339.                 (org.drip.state.identifier.CustomLabel) latentStateLabel,
  1340.                 value
  1341.             );
  1342.         }

  1343.         if (latentStateLabel instanceof org.drip.state.identifier.GovvieLabel)
  1344.         {
  1345.             return add (
  1346.                 (org.drip.state.identifier.GovvieLabel) latentStateLabel,
  1347.                 value
  1348.             );
  1349.         }

  1350.         if (latentStateLabel instanceof org.drip.state.identifier.RatingLabel)
  1351.         {
  1352.             {
  1353.                 return add (
  1354.                     (org.drip.state.identifier.RatingLabel) latentStateLabel,
  1355.                     value
  1356.                 );
  1357.             }
  1358.         }

  1359.         if (latentStateLabel instanceof org.drip.state.identifier.ForwardLabel)
  1360.         {
  1361.             {
  1362.                 return add (
  1363.                     (org.drip.state.identifier.ForwardLabel) latentStateLabel,
  1364.                     value
  1365.                 );
  1366.             }
  1367.         }

  1368.         if (latentStateLabel instanceof org.drip.state.identifier.FundingLabel)
  1369.         {
  1370.             return add (
  1371.                 (org.drip.state.identifier.FundingLabel) latentStateLabel,
  1372.                 value
  1373.             );
  1374.         }

  1375.         if (latentStateLabel instanceof org.drip.state.identifier.PaydownLabel)
  1376.         {
  1377.             return add (
  1378.                 (org.drip.state.identifier.PaydownLabel) latentStateLabel,
  1379.                 value
  1380.             );
  1381.         }

  1382.         if (latentStateLabel instanceof org.drip.state.identifier.OvernightLabel)
  1383.         {
  1384.             return add (
  1385.                 (org.drip.state.identifier.OvernightLabel) latentStateLabel,
  1386.                 value
  1387.             );
  1388.         }

  1389.         if (latentStateLabel instanceof org.drip.state.identifier.CollateralLabel)
  1390.         {
  1391.             return add (
  1392.                 (org.drip.state.identifier.CollateralLabel) latentStateLabel,
  1393.                 value
  1394.             );
  1395.         }

  1396.         if (latentStateLabel instanceof org.drip.state.identifier.VolatilityLabel)
  1397.         {
  1398.             return add (
  1399.                 (org.drip.state.identifier.VolatilityLabel) latentStateLabel,
  1400.                 value
  1401.             );
  1402.         }

  1403.         if (latentStateLabel instanceof org.drip.state.identifier.OTCFixFloatLabel)
  1404.         {
  1405.             return add (
  1406.                 (org.drip.state.identifier.OTCFixFloatLabel) latentStateLabel,
  1407.                 value
  1408.             );
  1409.         }

  1410.         if (latentStateLabel instanceof org.drip.state.identifier.EntityCreditLabel)
  1411.         {
  1412.             return add (
  1413.                 (org.drip.state.identifier.EntityCreditLabel) latentStateLabel,
  1414.                 value
  1415.             );
  1416.         }

  1417.         if (latentStateLabel instanceof org.drip.state.identifier.EntityEquityLabel)
  1418.         {
  1419.             return add (
  1420.                 (org.drip.state.identifier.EntityEquityLabel) latentStateLabel,
  1421.                 value
  1422.             );
  1423.         }

  1424.         if (latentStateLabel instanceof org.drip.state.identifier.EntityHazardLabel)
  1425.         {
  1426.             return add (
  1427.                 (org.drip.state.identifier.EntityHazardLabel) latentStateLabel,
  1428.                 value
  1429.             );
  1430.         }

  1431.         if (latentStateLabel instanceof org.drip.state.identifier.EntityFundingLabel)
  1432.         {
  1433.             return add (
  1434.                 (org.drip.state.identifier.EntityFundingLabel) latentStateLabel,
  1435.                 value
  1436.             );
  1437.         }

  1438.         if (latentStateLabel instanceof org.drip.state.identifier.EntityRecoveryLabel)
  1439.         {
  1440.             return add (
  1441.                 (org.drip.state.identifier.EntityRecoveryLabel) latentStateLabel,
  1442.                 value
  1443.             );
  1444.         }

  1445.         return false;
  1446.     }

  1447.     /**
  1448.      * Retrieve the Value Corresponding to the Specific Latent State
  1449.      *
  1450.      * @param latentStateLabel The Latent State Label
  1451.      *
  1452.      * @return The Value Corresponding to the Specific Latent State
  1453.      *
  1454.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  1455.      */

  1456.     public double value (
  1457.         final org.drip.state.identifier.LatentStateLabel latentStateLabel)
  1458.         throws java.lang.Exception
  1459.     {
  1460.         if (null == latentStateLabel)
  1461.         {
  1462.             throw new java.lang.Exception ("LatentStateVertexContainer::value => Invalid State Label");
  1463.         }

  1464.         if (latentStateLabel instanceof org.drip.state.identifier.FXLabel)
  1465.         {
  1466.             return fx ((org.drip.state.identifier.FXLabel) latentStateLabel);
  1467.         }

  1468.         if (latentStateLabel instanceof org.drip.state.identifier.CSALabel)
  1469.         {
  1470.             return csa ((org.drip.state.identifier.CSALabel) latentStateLabel);
  1471.         }

  1472.         if (latentStateLabel instanceof org.drip.state.identifier.RepoLabel)
  1473.         {
  1474.             return repo ((org.drip.state.identifier.RepoLabel) latentStateLabel);
  1475.         }

  1476.         if (latentStateLabel instanceof org.drip.state.identifier.CustomLabel)
  1477.         {
  1478.             return custom ((org.drip.state.identifier.CustomLabel) latentStateLabel);
  1479.         }

  1480.         if (latentStateLabel instanceof org.drip.state.identifier.GovvieLabel)
  1481.         {
  1482.             return govvie ((org.drip.state.identifier.GovvieLabel) latentStateLabel);
  1483.         }

  1484.         if (latentStateLabel instanceof org.drip.state.identifier.RatingLabel)
  1485.         {
  1486.             return rating ((org.drip.state.identifier.RatingLabel) latentStateLabel);
  1487.         }

  1488.         if (latentStateLabel instanceof org.drip.state.identifier.ForwardLabel)
  1489.         {
  1490.             return forward ((org.drip.state.identifier.ForwardLabel) latentStateLabel);
  1491.         }

  1492.         if (latentStateLabel instanceof org.drip.state.identifier.FundingLabel)
  1493.         {
  1494.             return funding ((org.drip.state.identifier.FundingLabel) latentStateLabel);
  1495.         }

  1496.         if (latentStateLabel instanceof org.drip.state.identifier.PaydownLabel)
  1497.         {
  1498.             return payDown ((org.drip.state.identifier.PaydownLabel) latentStateLabel);
  1499.         }

  1500.         if (latentStateLabel instanceof org.drip.state.identifier.OvernightLabel)
  1501.         {
  1502.             return overnight ((org.drip.state.identifier.OvernightLabel) latentStateLabel);
  1503.         }

  1504.         if (latentStateLabel instanceof org.drip.state.identifier.CollateralLabel)
  1505.         {
  1506.             return collateral ((org.drip.state.identifier.CollateralLabel) latentStateLabel);
  1507.         }

  1508.         if (latentStateLabel instanceof org.drip.state.identifier.VolatilityLabel)
  1509.         {
  1510.             return volatility ((org.drip.state.identifier.VolatilityLabel) latentStateLabel);
  1511.         }

  1512.         if (latentStateLabel instanceof org.drip.state.identifier.OTCFixFloatLabel)
  1513.         {
  1514.             return otcFixFloat ((org.drip.state.identifier.OTCFixFloatLabel) latentStateLabel);
  1515.         }

  1516.         if (latentStateLabel instanceof org.drip.state.identifier.EntityCreditLabel)
  1517.         {
  1518.             return entityCredit ((org.drip.state.identifier.EntityCreditLabel) latentStateLabel);
  1519.         }

  1520.         if (latentStateLabel instanceof org.drip.state.identifier.EntityEquityLabel)
  1521.         {
  1522.             return entityEquity ((org.drip.state.identifier.EntityEquityLabel) latentStateLabel);
  1523.         }

  1524.         if (latentStateLabel instanceof org.drip.state.identifier.EntityHazardLabel)
  1525.         {
  1526.             return entityHazard ((org.drip.state.identifier.EntityHazardLabel) latentStateLabel);
  1527.         }

  1528.         if (latentStateLabel instanceof org.drip.state.identifier.EntityFundingLabel)
  1529.         {
  1530.             return entityFunding ((org.drip.state.identifier.EntityFundingLabel) latentStateLabel);
  1531.         }

  1532.         if (latentStateLabel instanceof org.drip.state.identifier.EntityRecoveryLabel)
  1533.         {
  1534.             return entityRecovery ((org.drip.state.identifier.EntityRecoveryLabel) latentStateLabel);
  1535.         }

  1536.         throw new java.lang.Exception ("LatentStateVertexContainer::value => Invalid State Label");
  1537.     }

  1538.     /**
  1539.      * Retrieve the List of all Loaded Labels
  1540.      *
  1541.      * @return The List of all Loaded Labels
  1542.      */

  1543.     public java.util.List<org.drip.state.identifier.LatentStateLabel> labelList()
  1544.     {
  1545.         return _loadedLabelList;
  1546.     }
  1547. }