From 56adc48a26c1e5a457703077adcb757c105e796e Mon Sep 17 00:00:00 2001 From: Lakshmi Krishnamurthy Date: Sat, 23 Dec 2023 15:44:48 -0500 Subject: [PATCH] Features: Bug Fixes/Re-organization: - State Identifier Entity Credit Label (1, 2) - State Identifier Entity Credit Label - Match (3, 4) - State Identifier Entity Equity Label #1 (5, 6, 7) - State Identifier Entity Equity Label #2 (8) - State Identifier Entity Equity Label - Match (9, 10) - State Identifier Entity Funding Label #1 (11, 12, 13) - State Identifier Entity Funding Label #2 (14, 15, 16) - State Identifier Entity Funding Label - Match (17, 18) - State Identifier Entity Hazard Label #1 (19, 20, 21) - State Identifier Entity Hazard Label #2 (22) - State Identifier Entity Hazard Label - Match (23, 24) - State Identifier Entity Recovery Label #1 (25, 26, 27) - State Identifier Entity Recovery Label #2 (28, 29, 30) - State Identifier Entity Recovery Label - Match (31, 32) - State Identifier Floater Label (33, 34, 35) - State Identifier Floater Label - Tenor (36, 37) - State Identifier Floater Label - Index (38, 39) - State Identifier Floater Label - Constructor (40, 41) - State Identifier Floater Label - Currency (42) - State Identifier Floater Label - Family (43) - State Identifier Floater Label - Unit Coupon Accrual Setting (44, 45, 46) - State Identifier Floater Label - Fully Qualified Name (47) - State Identifier Floater Label - Match (48, 49) - State Identifier Forward Label #1 (50, 51, 52) - State Identifier Forward Label #2 (53, 54) - State Identifier Forward Label - Standard (55, 56, 57) - State Identifier Forward Label - Create (58, 59, 60) Samples: IdeaDRIP: --- ReleaseNotes/02_15_2023.txt | 37 +++++++ ScheduleSheet.xlsx | Bin 48708 -> 48711 bytes .../state/identifier/EntityCreditLabel.java | 3 + .../state/identifier/EntityEquityLabel.java | 68 ++++++------ .../state/identifier/EntityFundingLabel.java | 87 ++++++++------- .../state/identifier/EntityHazardLabel.java | 66 ++++++------ .../state/identifier/EntityRecoveryLabel.java | 84 +++++++-------- .../drip/state/identifier/FloaterLabel.java | 95 +++++++++++------ .../drip/state/identifier/ForwardLabel.java | 99 ++++++++++-------- 9 files changed, 314 insertions(+), 225 deletions(-) create mode 100644 ReleaseNotes/02_15_2023.txt diff --git a/ReleaseNotes/02_15_2023.txt b/ReleaseNotes/02_15_2023.txt new file mode 100644 index 000000000000..620aa5299678 --- /dev/null +++ b/ReleaseNotes/02_15_2023.txt @@ -0,0 +1,37 @@ + +Features: + +Bug Fixes/Re-organization: + + - State Identifier Entity Credit Label (1, 2) + - State Identifier Entity Credit Label - Match (3, 4) + - State Identifier Entity Equity Label #1 (5, 6, 7) + - State Identifier Entity Equity Label #2 (8) + - State Identifier Entity Equity Label - Match (9, 10) + - State Identifier Entity Funding Label #1 (11, 12, 13) + - State Identifier Entity Funding Label #2 (14, 15, 16) + - State Identifier Entity Funding Label - Match (17, 18) + - State Identifier Entity Hazard Label #1 (19, 20, 21) + - State Identifier Entity Hazard Label #2 (22) + - State Identifier Entity Hazard Label - Match (23, 24) + - State Identifier Entity Recovery Label #1 (25, 26, 27) + - State Identifier Entity Recovery Label #2 (28, 29, 30) + - State Identifier Entity Recovery Label - Match (31, 32) + - State Identifier Floater Label (33, 34, 35) + - State Identifier Floater Label - Tenor (36, 37) + - State Identifier Floater Label - Index (38, 39) + - State Identifier Floater Label - Constructor (40, 41) + - State Identifier Floater Label - Currency (42) + - State Identifier Floater Label - Family (43) + - State Identifier Floater Label - Unit Coupon Accrual Setting (44, 45, 46) + - State Identifier Floater Label - Fully Qualified Name (47) + - State Identifier Floater Label - Match (48, 49) + - State Identifier Forward Label #1 (50, 51, 52) + - State Identifier Forward Label #2 (53, 54) + - State Identifier Forward Label - Standard (55, 56, 57) + - State Identifier Forward Label - Create (58, 59, 60) + + +Samples: + +IdeaDRIP: diff --git a/ScheduleSheet.xlsx b/ScheduleSheet.xlsx index e3d295254258bd479c57bebc128e5155e779c2ca..8b1b25e9660b92a704ea794c44e73bde3922ba8e 100644 GIT binary patch delta 1382 zcmV-s1)2K9`~t`P0O_QqXf8R9;=|^6=c2QzuU+4IodymcdbX%3iJr$DiIzsrwMh2}jp0oNc zLccHP<_H;5kvb3c zodC48BYmVF+ZM*JQm{SF!TXS0OVEFNrfYa$CA<%^@(x(uGZ?l%jfTNmomWCg-Urc! z2W}3Uj909rS3Bz(q-lPTN>{2xMoFZa z&RhVH7<%v@10mS8W8V&3 z)1D26raKB8bL0*jGjUUAHuPudY&z7H)Gvtee_WH@F$nuNk7ijAp)Li<*6_Z%psOj7 zV7*Sg1w6sIJ!`A~*W>{&lL4s}vmOdc0tGXSv8g(N5HQ>r`cCh>Q{xff1Ed zW;;V~>qR_4k@MV0URDNXr~!xO`Rz?6Y9=ZRFSe?|dIc^DB;%N zydJD}e_rU6fm18r)S=Tk?vO3TN$lN6r+VYza2OrZE=I^t@W*QT+EtB}X?G<6<(U*r zSm3_0`I7Hkp;d+lvvz+acYYOCy-^?^nu{%Zw#pTT>%H|wli}aS!0xI;oE`ufg>dXt z<)XZ&k5B6b%4tGroJ?XeT~orwV@A`@HpkWdHtcDj&uRWArZJ&0P1iJGcZAXDfOrAq zUGD1-l79oU6}M9Z1=LSj4+fKMx>5lVlfb$y95alusXBT905!7%02lxO0000000000 o0001643kg06|)|@qXGq~JB6z1f8TW=l$MvS9RfS{HOJ@Nd+hWscSUYIP$3yFV}vhkWY99HG0K#xBFmCVMhhY@ctuNythj$D zh=QS5Te1?Aq%xya6}jcuwr>@Lm1vI;iT7ae)ruu_%#*sHrP_lCniB=|WyUJmq7}(| z;0hu(b!8^Jr~qQga;6>|P-GNIG+UQkkYx_Cci1y_0=_={unmpV?gXK;tqPV1F8NAb z0JOCyeWoAV7RIkqushGe`;c5q&2hqGE zHwX25E0)uny>$&zRX<3fE0rT7CsIvPrf3?Y0ET=^UrmU*8rCd_s1w*uh^+q6&U0a; zbVcf1U4xNZcsLopA3C013C0-Yii(mbI^v}QA0Bjl)^iQ^DC6L8V?qDaOi+I~Sl}h$+`Le!I31*LG=}p|QJVWy-fPGO@Ps>zX-M%D?X=Gp{mO>dNq)faiwk{$G;;sTH#y3Q7V6U56mpJF{*KFLr-dH7kaxb-||pjsTy}Pc0Ko zdist)6rI)iP4ueIqJyJ#p~bv`z=NQP-_#olcv{C-X@X^11($M@ z2mYTQb2k^uk|!Ab)AQf|^5;MQ^T(h5`KN#X{{XWxgKjYe3ZS%DQnRJBG68>^CS@{9 z+kwhn+(2-m_!g48HLOWXlG*j&o3>lsP<+fiCtuFFBwHL+6?}oQver2wQH%o6ycSaL za`d)YhI15H$FyKotszGpShOf^Z!+Gbyf*M+>IRIHU;|ImHswu@O6QssW6MiW%tqd! zy|}H7V$L7U4mXVN*$yy`<2!$>z%jub!#yx;CL%f^1)q@3!Bhi4a10eF(9U8K5&YwI zV3hsy!k}C@m2_R>JDuWQvIQT-$$hkPGPZ3SwaE~}=O_4My?Pz0hEn&t;(&@w@RS>1 zt~SMr?QN-KhA(FQ{wikO+OK*mK|FM4Tkve8Ej3dIzm1+fR2e`Y01^0b=~(5g zyeE%On5uX3IG6;FA5ry;JOeSU56mpJ9+>BHM0W%7ytkO00000 m00000003IE3%j`j1qz_FSW=V8y;K1klODb!2Hv><00030M~)c) diff --git a/src/main/java/org/drip/state/identifier/EntityCreditLabel.java b/src/main/java/org/drip/state/identifier/EntityCreditLabel.java index df2a809e0acb..d8b999b2943f 100644 --- a/src/main/java/org/drip/state/identifier/EntityCreditLabel.java +++ b/src/main/java/org/drip/state/identifier/EntityCreditLabel.java @@ -6,6 +6,9 @@ */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy diff --git a/src/main/java/org/drip/state/identifier/EntityEquityLabel.java b/src/main/java/org/drip/state/identifier/EntityEquityLabel.java index f4078a63548f..b40ac529c768 100644 --- a/src/main/java/org/drip/state/identifier/EntityEquityLabel.java +++ b/src/main/java/org/drip/state/identifier/EntityEquityLabel.java @@ -6,6 +6,9 @@ */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -83,21 +86,31 @@ /** * EntityEquityLabel contains the Identifier Parameters referencing the Latent State of the Entity - * Equity Curve. - * - *

+ * Equity Curve. It implements the following Functionality. + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ -public class EntityEquityLabel extends org.drip.state.identifier.EntityDesignateLabel +public class EntityEquityLabel extends EntityDesignateLabel { /** @@ -110,18 +123,12 @@ public class EntityEquityLabel extends org.drip.state.identifier.EntityDesignate */ public static final EntityEquityLabel Standard ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { - return new EntityEquityLabel ( - referenceEntity, - currency - ); - } - catch (java.lang.Exception e) - { + try { + return new EntityEquityLabel (referenceEntity, currency); + } catch (Exception e) { e.printStackTrace(); } @@ -129,29 +136,26 @@ public static final EntityEquityLabel Standard ( } /** - * EntityEquityLabel constructor + * EntityEquityLabel constructor * * @param referenceEntity The Reference Entity * @param currency The Currency * - * @throws java.lang.Exception Thrown if the inputs are invalid + * @throws Exception Thrown if the inputs are invalid */ private EntityEquityLabel ( - final java.lang.String referenceEntity, - final java.lang.String currency) - throws java.lang.Exception + final String referenceEntity, + final String currency) + throws Exception { - super ( - referenceEntity, - currency - ); + super (referenceEntity, currency); } @Override public boolean match ( - final org.drip.state.identifier.LatentStateLabel lslOther) + final LatentStateLabel latentStateLabelOther) { - return null == lslOther || !(lslOther instanceof org.drip.state.identifier.EntityEquityLabel) ? false - : super.match (lslOther); + return null != latentStateLabelOther && latentStateLabelOther instanceof EntityEquityLabel && + super.match (latentStateLabelOther); } } diff --git a/src/main/java/org/drip/state/identifier/EntityFundingLabel.java b/src/main/java/org/drip/state/identifier/EntityFundingLabel.java index a7dc44fe3bac..ca48746f197f 100644 --- a/src/main/java/org/drip/state/identifier/EntityFundingLabel.java +++ b/src/main/java/org/drip/state/identifier/EntityFundingLabel.java @@ -6,6 +6,9 @@ */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -79,16 +82,27 @@ /** * EntityFundingLabel contains the Identifier Parameters referencing the Latent State of the Entity - * Funding Curve. - * - *

+ * Funding Curve. It implements the following Functionality. + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ @@ -106,19 +120,12 @@ public class EntityFundingLabel extends org.drip.state.identifier.EntityCreditLa */ public static final EntityFundingLabel Senior ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { - return new EntityFundingLabel ( - referenceEntity, - currency, - org.drip.state.identifier.EntityCreditLabel.SENIORITY_SENIOR - ); - } - catch (java.lang.Exception e) - { + try { + return new EntityFundingLabel (referenceEntity, currency, EntityCreditLabel.SENIORITY_SENIOR); + } catch (Exception e) { e.printStackTrace(); } @@ -135,19 +142,15 @@ public static final EntityFundingLabel Senior ( */ public static final EntityFundingLabel Subordinate ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { - return new EntityFundingLabel ( - referenceEntity, + try { + return new EntityFundingLabel (referenceEntity, currency, - org.drip.state.identifier.EntityCreditLabel.SENIORITY_SUBORDINATE + EntityCreditLabel.SENIORITY_SUBORDINATE ); - } - catch (java.lang.Exception e) - { + } catch (Exception e) { e.printStackTrace(); } @@ -155,32 +158,28 @@ public static final EntityFundingLabel Subordinate ( } /** - * EntityFundingLabel constructor + * EntityFundingLabel constructor * * @param referenceEntity The Reference Entity * @param currency The Currency * @param seniority The Obligation Seniority * - * @throws java.lang.Exception Thrown if the inputs are invalid + * @throws Exception Thrown if the inputs are invalid */ public EntityFundingLabel ( - final java.lang.String referenceEntity, - final java.lang.String currency, - final java.lang.String seniority) - throws java.lang.Exception + final String referenceEntity, + final String currency, + final String seniority) + throws Exception { - super ( - referenceEntity, - currency, - seniority - ); + super (referenceEntity, currency, seniority); } @Override public boolean match ( - final org.drip.state.identifier.LatentStateLabel lslOther) + final LatentStateLabel latentStateLabelOther) { - return null == lslOther || !(lslOther instanceof org.drip.state.identifier.EntityFundingLabel) ? - false : super.match (lslOther); + return null != latentStateLabelOther && latentStateLabelOther instanceof EntityFundingLabel && + super.match (latentStateLabelOther); } } diff --git a/src/main/java/org/drip/state/identifier/EntityHazardLabel.java b/src/main/java/org/drip/state/identifier/EntityHazardLabel.java index c0bb806c5445..087c34a02b2a 100644 --- a/src/main/java/org/drip/state/identifier/EntityHazardLabel.java +++ b/src/main/java/org/drip/state/identifier/EntityHazardLabel.java @@ -6,6 +6,9 @@ */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -79,21 +82,31 @@ /** * EntityHazardLabel contains the Identifier Parameters referencing the Latent State of the Entity - * Hazard Curve. - * - *

+ * Hazard Curve. It implements the following Functionality. + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ -public class EntityHazardLabel extends org.drip.state.identifier.EntityDesignateLabel +public class EntityHazardLabel extends EntityDesignateLabel { /** @@ -106,18 +119,12 @@ public class EntityHazardLabel extends org.drip.state.identifier.EntityDesignate */ public static final EntityHazardLabel Standard ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { - return new EntityHazardLabel ( - referenceEntity, - currency - ); - } - catch (java.lang.Exception e) - { + try { + return new EntityHazardLabel (referenceEntity, currency); + } catch (Exception e) { e.printStackTrace(); } @@ -130,24 +137,21 @@ public static final EntityHazardLabel Standard ( * @param referenceEntity The Reference Entity * @param currency The Currency * - * @throws java.lang.Exception Thrown if the inputs are invalid + * @throws Exception Thrown if the inputs are invalid */ public EntityHazardLabel ( - final java.lang.String referenceEntity, - final java.lang.String currency) - throws java.lang.Exception + final String referenceEntity, + final String currency) + throws Exception { - super ( - referenceEntity, - currency - ); + super (referenceEntity, currency); } @Override public boolean match ( - final org.drip.state.identifier.LatentStateLabel lslOther) + final LatentStateLabel latentStateLabelOther) { - return null == lslOther || !(lslOther instanceof org.drip.state.identifier.EntityHazardLabel) ? false - : super.match (lslOther); + return null != latentStateLabelOther && latentStateLabelOther instanceof EntityHazardLabel && + super.match (latentStateLabelOther); } } diff --git a/src/main/java/org/drip/state/identifier/EntityRecoveryLabel.java b/src/main/java/org/drip/state/identifier/EntityRecoveryLabel.java index 987cccddfd50..557136263d4d 100644 --- a/src/main/java/org/drip/state/identifier/EntityRecoveryLabel.java +++ b/src/main/java/org/drip/state/identifier/EntityRecoveryLabel.java @@ -6,6 +6,9 @@ */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -83,21 +86,32 @@ /** * EntityRecoveryLabel contains the Identifier Parameters referencing the Latent State of the Entity - * Recovery Curve. - * - *

+ * Recovery Curve. It implements the following Functionality. + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ -public class EntityRecoveryLabel extends org.drip.state.identifier.EntityCreditLabel +public class EntityRecoveryLabel extends EntityCreditLabel { /** @@ -110,19 +124,12 @@ public class EntityRecoveryLabel extends org.drip.state.identifier.EntityCreditL */ public static final EntityRecoveryLabel Senior ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { - return new EntityRecoveryLabel ( - referenceEntity, - currency, - org.drip.state.identifier.EntityCreditLabel.SENIORITY_SENIOR - ); - } - catch (java.lang.Exception e) - { + try { + return new EntityRecoveryLabel (referenceEntity, currency, EntityCreditLabel.SENIORITY_SENIOR); + } catch (Exception e) { e.printStackTrace(); } @@ -139,19 +146,16 @@ public static final EntityRecoveryLabel Senior ( */ public static final EntityRecoveryLabel Subordinate ( - final java.lang.String referenceEntity, - final java.lang.String currency) + final String referenceEntity, + final String currency) { - try - { + try { return new EntityRecoveryLabel ( referenceEntity, currency, - org.drip.state.identifier.EntityCreditLabel.SENIORITY_SUBORDINATE + EntityCreditLabel.SENIORITY_SUBORDINATE ); - } - catch (java.lang.Exception e) - { + } catch (Exception e) { e.printStackTrace(); } @@ -165,26 +169,22 @@ public static final EntityRecoveryLabel Subordinate ( * @param currency The Currency * @param seniority The Obligation Seniority * - * @throws java.lang.Exception Thrown if the inputs are invalid + * @throws Exception Thrown if the inputs are invalid */ private EntityRecoveryLabel ( - final java.lang.String referenceEntity, - final java.lang.String currency, - final java.lang.String seniority) - throws java.lang.Exception + final String referenceEntity, + final String currency, + final String seniority) + throws Exception { - super ( - referenceEntity, - currency, - seniority - ); + super (referenceEntity, currency, seniority); } @Override public boolean match ( - final org.drip.state.identifier.LatentStateLabel lslOther) + final LatentStateLabel latentStateLabelOther) { - return null == lslOther || !(lslOther instanceof org.drip.state.identifier.EntityRecoveryLabel) ? - false : super.match (lslOther); + return null != latentStateLabelOther && latentStateLabelOther instanceof EntityRecoveryLabel && + super.match (latentStateLabelOther); } } diff --git a/src/main/java/org/drip/state/identifier/FloaterLabel.java b/src/main/java/org/drip/state/identifier/FloaterLabel.java index 8fccb5aaec00..afabaf35b846 100644 --- a/src/main/java/org/drip/state/identifier/FloaterLabel.java +++ b/src/main/java/org/drip/state/identifier/FloaterLabel.java @@ -1,11 +1,18 @@ package org.drip.state.identifier; +import org.drip.analytics.support.Helper; +import org.drip.market.definition.FloaterIndex; +import org.drip.param.period.UnitCouponAccrualSetting; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -80,32 +87,47 @@ /** * FloaterLabel is an Abstract Class that underpins the Latent State Labels that use a Single Floater - * Index. - * - *

+ * Index. It implements the following Functionality. + * * - *

+ * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ -public abstract class FloaterLabel implements org.drip.state.identifier.LatentStateLabel +public abstract class FloaterLabel implements LatentStateLabel { - private java.lang.String _strTenor = ""; - private org.drip.market.definition.FloaterIndex _floaterIndex = null; + private String _tenor = ""; + private FloaterIndex _floaterIndex = null; protected FloaterLabel ( - final org.drip.market.definition.FloaterIndex floaterIndex, - final java.lang.String strTenor) - throws java.lang.Exception + final FloaterIndex floaterIndex, + final String strTenor) + throws Exception { - if (null == (_floaterIndex = floaterIndex) || null == (_strTenor = strTenor) || _strTenor.isEmpty()) - throw new java.lang.Exception ("FloaterLabel ctr: Invalid Inputs"); + if (null == (_floaterIndex = floaterIndex) || null == (_tenor = strTenor) || _tenor.isEmpty()) { + throw new Exception ("FloaterLabel ctr: Invalid Inputs"); + } } /** @@ -114,7 +136,7 @@ protected FloaterLabel ( * @return The Currency */ - public java.lang.String currency() + public String currency() { return _floaterIndex.currency(); } @@ -125,7 +147,7 @@ public java.lang.String currency() * @return The Family */ - public java.lang.String family() + public String family() { return _floaterIndex.family(); } @@ -136,9 +158,9 @@ public java.lang.String family() * @return The Tenor */ - public java.lang.String tenor() + public String tenor() { - return _strTenor; + return _tenor; } /** @@ -149,7 +171,7 @@ public java.lang.String tenor() public boolean overnight() { - return "ON".equalsIgnoreCase (_strTenor) || "1D".equalsIgnoreCase (_strTenor); + return "ON".equalsIgnoreCase (_tenor) || "1D".equalsIgnoreCase (_tenor); } /** @@ -158,7 +180,7 @@ public boolean overnight() * @return The Floater Index */ - public org.drip.market.definition.FloaterIndex floaterIndex() + public FloaterIndex floaterIndex() { return _floaterIndex; } @@ -169,30 +191,37 @@ public org.drip.market.definition.FloaterIndex floaterIndex() * @return Unit Coupon Accrual Setting */ - public org.drip.param.period.UnitCouponAccrualSetting ucas() + public UnitCouponAccrualSetting ucas() { - java.lang.String strDayCount = _floaterIndex.dayCount(); + String dayCount = _floaterIndex.dayCount(); try { - return new org.drip.param.period.UnitCouponAccrualSetting (overnight() ? 360 : - org.drip.analytics.support.Helper.TenorToFreq (_strTenor), strDayCount, false, strDayCount, - false, _floaterIndex.currency(), false, _floaterIndex.accrualCompoundingRule()); - } catch (java.lang.Exception e) { + return new UnitCouponAccrualSetting ( + overnight() ? 360 : Helper.TenorToFreq (_tenor), + dayCount, + false, + dayCount, + false, + _floaterIndex.currency(), + false, + _floaterIndex.accrualCompoundingRule() + ); + } catch (Exception e) { e.printStackTrace(); } return null; } - @Override public java.lang.String fullyQualifiedName() + @Override public String fullyQualifiedName() { - return _floaterIndex.currency() + "-" + _floaterIndex.family() + "-" + _strTenor; + return _floaterIndex.currency() + "-" + _floaterIndex.family() + "-" + _tenor; } @Override public boolean match ( - final org.drip.state.identifier.LatentStateLabel lslOther) + final LatentStateLabel latentStateLabelOther) { - return null == lslOther || !(lslOther instanceof org.drip.state.identifier.ForwardLabel) ? false : - fullyQualifiedName().equalsIgnoreCase (lslOther.fullyQualifiedName()); + return null != latentStateLabelOther && latentStateLabelOther instanceof ForwardLabel && + fullyQualifiedName().equalsIgnoreCase (latentStateLabelOther.fullyQualifiedName()); } } diff --git a/src/main/java/org/drip/state/identifier/ForwardLabel.java b/src/main/java/org/drip/state/identifier/ForwardLabel.java index 5d4f4e19c2f4..847cbe3dfd5a 100644 --- a/src/main/java/org/drip/state/identifier/ForwardLabel.java +++ b/src/main/java/org/drip/state/identifier/ForwardLabel.java @@ -1,11 +1,18 @@ package org.drip.state.identifier; +import org.drip.market.definition.FloaterIndex; +import org.drip.market.definition.IBORIndexContainer; +import org.drip.market.definition.OvernightIndexContainer; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -88,56 +95,62 @@ * *

*
    - *
  • - * Indicate if the Index is an Overnight Index - *
  • - *
  • - * Retrieve Index, Tenor, Currency, and Fully Qualified Name - *
  • + *
  • Indicate if the Index is an Overnight Index
  • + *
  • Retrieve Index, Tenor, Currency, and Fully Qualified Name
  • + *
  • Construct a ForwardLabel from the corresponding Fully Qualified Name
  • + *
  • Construct a ForwardLabel from the tenor and the index
  • + *
  • Create from the Currency and the Tenor
  • *
* - *

- * - *

+ *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Identifier Labels
* * @author Lakshmi Krishnamurthy */ -public class ForwardLabel extends org.drip.state.identifier.FloaterLabel { +public class ForwardLabel extends FloaterLabel +{ /** * Construct a ForwardLabel from the corresponding Fully Qualified Name * - * @param strFullyQualifiedName The Fully Qualified Name + * @param fullyQualifiedName The Fully Qualified Name * * @return ForwardLabel Instance */ public static final ForwardLabel Standard ( - final java.lang.String strFullyQualifiedName) + final String fullyQualifiedName) { - if (null == strFullyQualifiedName || strFullyQualifiedName.isEmpty()) return null; - - java.lang.String[] astr = strFullyQualifiedName.split ("-"); + if (null == fullyQualifiedName || fullyQualifiedName.isEmpty()) { + return null; + } - if (null == astr || 2 != astr.length) return null; + String[] stringArray = fullyQualifiedName.split ("-"); - java.lang.String strTenor = astr[1]; - java.lang.String strCurrency = astr[0]; + if (null == stringArray || 2 != stringArray.length) { + return null; + } - org.drip.market.definition.FloaterIndex floaterIndex = "ON".equalsIgnoreCase (strTenor) || - "1D".equalsIgnoreCase (strTenor) ? - org.drip.market.definition.OvernightIndexContainer.IndexFromJurisdiction (strCurrency) : - org.drip.market.definition.IBORIndexContainer.IndexFromJurisdiction (strCurrency); + FloaterIndex floaterIndex = "ON".equalsIgnoreCase (stringArray[1]) || + "1D".equalsIgnoreCase (stringArray[1]) ? + OvernightIndexContainer.IndexFromJurisdiction (stringArray[0]) : + IBORIndexContainer.IndexFromJurisdiction (stringArray[0]); try { - return new ForwardLabel (floaterIndex, strTenor); - } catch (java.lang.Exception e) { + return new ForwardLabel (floaterIndex, stringArray[1]); + } catch (Exception e) { e.printStackTrace(); } @@ -148,18 +161,18 @@ public static final ForwardLabel Standard ( * Construct a ForwardLabel from the tenor and the index * * @param floaterIndex The Floater Index Details - * @param strTenor Tenor + * @param tenor Tenor * * @return ForwardLabel Instance */ public static final ForwardLabel Create ( - final org.drip.market.definition.FloaterIndex floaterIndex, - final java.lang.String strTenor) + final FloaterIndex floaterIndex, + final String tenor) { try { - return new ForwardLabel (floaterIndex, strTenor); - } catch (java.lang.Exception e) { + return new ForwardLabel (floaterIndex, tenor); + } catch (Exception e) { e.printStackTrace(); } @@ -169,24 +182,24 @@ public static final ForwardLabel Create ( /** * Create from the Currency and the Tenor * - * @param strCurrency Currency - * @param strTenor Tenor + * @param currency Currency + * @param tenor Tenor * * @return ForwardLabel Instance */ public static final ForwardLabel Create ( - final java.lang.String strCurrency, - final java.lang.String strTenor) + final String currency, + final String tenor) { - return Standard (strCurrency + "-" + strTenor); + return Standard (currency + "-" + tenor); } protected ForwardLabel ( - final org.drip.market.definition.FloaterIndex floaterIndex, - final java.lang.String strTenor) - throws java.lang.Exception + final FloaterIndex floaterIndex, + final String tenor) + throws Exception { - super (floaterIndex, strTenor); + super (floaterIndex, tenor); } }