Package org.jquantlib.daycounters

Examples of org.jquantlib.daycounters.Business252$Impl


      for (int bondIndex = 0; bondIndex < maturityDates.length; bondIndex++) {

          // plain
          final InterestRate yield = new InterestRate(yields[bondIndex],
                             new Business252(new Brazil()),
                             Compounding.Compounded, Frequency.Annual);

          final Schedule schedule = new Schedule(new Date(1,Month.January,2007),
                            maturityDates[bondIndex], new Period(Frequency.Semiannual),
                            new Brazil(Brazil.Market.SETTLEMENT),
View Full Code Here


                -0.1507936507937,
                0.1507936507937,
                0.2023809523810
        };

        final DayCounter dayCounter = new Business252(new Brazil(Brazil.Market.SETTLEMENT));

        for (int i=1; i<testDates.length-1; i++) {
            final Date start = testDates[i-1];
            final Date end = testDates[i];
            /*@Time*/ final double  calculated = dayCounter.yearFraction(start, end);
            // System.out.println(calculated);
            assertFalse(dayCounter.getClass().getName()
                    +"\n from "+start
                    +"\n to "+end
                    +"\n calculated: "+calculated
                    +"\n expected:   "+expected[i],
                    abs(calculated - expected[i]) <= 1.0e-12);
View Full Code Here

                -0.1507936507937,
                0.1507936507937,
                0.2023809523810
        };

        final DayCounter dayCounter = new Business252(new Brazil(Brazil.Market.SETTLEMENT));

        for (int i=1; i<testDates.length-1; i++) {
            final Date start = testDates[i-1];
            final Date end = testDates[i];
            /*@Time*/ final double  calculated = dayCounter.yearFraction(start, end);
            // System.out.println(calculated);
            assertFalse(dayCounter.getClass().getName()
                    +"\n from "+start
                    +"\n to "+end
                    +"\n calculated: "+calculated
                    +"\n expected:   "+expected[i],
                    abs(calculated - expected[i]) <= 1.0e-12);
View Full Code Here

   
    @Test
    public void testEqualityHashCode() {

        QL.info("Testing Equality and HashCode ...");
        final DayCounter business252Brazil = new Business252(new Brazil(Brazil.Market.SETTLEMENT));
        final DayCounter business252Brazil1 = new Business252(new Brazil(Brazil.Market.SETTLEMENT));

       
        final DayCounter business252China = new Business252(new China(China.Market.SSE));
        final DayCounter simpleDayCounter = new SimpleDayCounter();     
        final DayCounter actual360 = new Actual360();       
        final DayCounter actual365Fixed = new Actual365Fixed();       
        final DayCounter actualActual = new ActualActual();       
        final DayCounter thirty360 = new Thirty360();       
        final DayCounter thirty360_2 = new Thirty360();
       
        assertFalse(thirty360.equals(null));
        assertEquals(thirty360, thirty360);
        assertEquals(thirty360, thirty360_2);
       
        assertFalse(simpleDayCounter.equals(business252Brazil));
        assertFalse(business252Brazil.equals(simpleDayCounter));
        assertFalse(actual360.equals(actual365Fixed));
        assertFalse(actual365Fixed.equals(actual360));
        assertFalse(actualActual.equals(thirty360));
        assertFalse(thirty360.equals(actualActual));
        assertFalse(business252Brazil.equals(business252China));
        assertFalse(business252China.equals(business252Brazil));
        assertTrue(business252Brazil.equals(business252Brazil1));
       
        assertTrue(business252Brazil.eq(business252Brazil1));
        assertFalse(business252Brazil.ne(business252Brazil1));
       
View Full Code Here

      for (int bondIndex = 0; bondIndex < maturityDates.length; bondIndex++) {

          // plain
          final InterestRate yield = new InterestRate(yields[bondIndex],
                             new Business252(new Brazil()),
                             Compounding.Compounded, Frequency.Annual);

          final Schedule schedule = new Schedule(new Date(1,Month.January,2007),
                            maturityDates[bondIndex], new Period(Frequency.Semiannual),
                            new Brazil(Brazil.Market.SETTLEMENT),
View Full Code Here

TOP

Related Classes of org.jquantlib.daycounters.Business252$Impl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.