Example #1
0
        //-------------------------------------------------------------------------
        public virtual void test_compareKey()
        {
            ZeroRateSensitivity a1    = ZeroRateSensitivity.of(GBP, YEARFRAC, 32d);
            ZeroRateSensitivity a2    = ZeroRateSensitivity.of(GBP, YEARFRAC, 32d);
            ZeroRateSensitivity b     = ZeroRateSensitivity.of(USD, YEARFRAC, 32d);
            ZeroRateSensitivity c     = ZeroRateSensitivity.of(GBP, YEARFRAC2, 32d);
            IborRateSensitivity other = IborRateSensitivity.of(IborIndexObservation.of(GBP_LIBOR_3M, date(2014, 6, 30), REF_DATA), 32d);

            assertEquals(a1.compareKey(a2), 0);
            assertEquals(a1.compareKey(b) < 0, true);
            assertEquals(b.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(c) < 0, true);
            assertEquals(c.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(other) > 0, true);
            assertEquals(other.compareKey(a1) < 0, true);
        }
Example #2
0
        //-------------------------------------------------------------------------
        public virtual void test_compareKey()
        {
            CreditCurveZeroRateSensitivity a1    = CreditCurveZeroRateSensitivity.of(LEGAL_ENTITY, GBP, YEAR_FRACTION, 32d);
            CreditCurveZeroRateSensitivity a2    = CreditCurveZeroRateSensitivity.of(LEGAL_ENTITY, GBP, YEAR_FRACTION, 32d);
            CreditCurveZeroRateSensitivity b     = CreditCurveZeroRateSensitivity.of(LEGAL_ENTITY, GBP, 10d, 32d);
            CreditCurveZeroRateSensitivity c     = CreditCurveZeroRateSensitivity.of(LEGAL_ENTITY, USD, YEAR_FRACTION, 32d);
            CreditCurveZeroRateSensitivity d     = CreditCurveZeroRateSensitivity.of(LEGAL_ENTITY, USD, YEAR_FRACTION, GBP, 32d);
            IborRateSensitivity            other = IborRateSensitivity.of(IborIndexObservation.of(GBP_LIBOR_3M, date(2014, 6, 30), REF_DATA), 32d);

            assertEquals(a1.compareKey(a2), 0);
            assertEquals(a1.compareKey(b) < 0, true);
            assertEquals(b.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(c) < 0, true);
            assertEquals(a1.compareKey(d) < 0, true);
            assertEquals(c.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(other) < 0, true);
            assertEquals(other.compareKey(a1) > 0, true);
        }
        public virtual void test_compareKey()
        {
            IssuerCurveZeroRateSensitivity a1    = IssuerCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, GROUP, VALUE);
            IssuerCurveZeroRateSensitivity a2    = IssuerCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, GROUP, VALUE);
            IssuerCurveZeroRateSensitivity b     = IssuerCurveZeroRateSensitivity.of(GBP, YEARFRAC, GROUP, VALUE);
            IssuerCurveZeroRateSensitivity c     = IssuerCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC2, GROUP, VALUE);
            IssuerCurveZeroRateSensitivity d     = IssuerCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, LegalEntityGroup.of("ISSUER2"), VALUE);
            IborRateSensitivity            other = IborRateSensitivity.of(IborIndexObservation.of(GBP_LIBOR_3M, date(2015, 8, 27), REF_DATA), 32d);

            assertEquals(a1.compareKey(a2), 0);
            assertEquals(a1.compareKey(b) > 0, true);
            assertEquals(b.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(c) < 0, true);
            assertEquals(c.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(d) < 0, true);
            assertEquals(d.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(other) > 0, true);
            assertEquals(other.compareKey(a1) < 0, true);
        }
Example #4
0
        public virtual void test_compareKey()
        {
            RepoCurveZeroRateSensitivity a1    = RepoCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, GROUP, VALUE);
            RepoCurveZeroRateSensitivity a2    = RepoCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, GROUP, VALUE);
            RepoCurveZeroRateSensitivity b     = RepoCurveZeroRateSensitivity.of(GBP, YEARFRAC, GROUP, VALUE);
            RepoCurveZeroRateSensitivity c     = RepoCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC2, GROUP, VALUE);
            RepoCurveZeroRateSensitivity d     = RepoCurveZeroRateSensitivity.of(CURRENCY, YEARFRAC, RepoGroup.of("ISSUER1 BND 3Y"), VALUE);
            IborRateSensitivity          other = IborRateSensitivity.of(IborIndexObservation.of(GBP_LIBOR_3M, date(2014, 6, 30), REF_DATA), 32d);

            assertEquals(a1.compareKey(a2), 0);
            assertEquals(a1.compareKey(b) > 0, true);
            assertEquals(b.compareKey(a1) < 0, true);
            assertEquals(a1.compareKey(c) < 0, true);
            assertEquals(c.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(d) < 0, true);
            assertEquals(d.compareKey(a1) > 0, true);
            assertEquals(a1.compareKey(other) > 0, true);
            assertEquals(other.compareKey(a1) < 0, true);
        }