@ Override public DateCalculator < E > moveByTenor ( final Tenor tenor , final int spotLag ) { if ( tenor == null ) { throw new IllegalArgumentException ( "Tenor cannot be null" ) ; } TenorCode tenorCode = tenor . getCode ( ) ; if ( tenorCode != TenorCode . OVERNIGHT && tenorCode != TenorCode . TOM_NEXT /*&& spotLag != 0*/ ) { // get to the Spot date first: moveToSpotDate ( spotLag ) ; } int unit = tenor . getUnits ( ) ; if ( tenorCode == TenorCode . WEEK ) { tenorCode = TenorCode . DAY ; unit *= DAYS_IN_WEEK ; } if ( tenorCode == TenorCode . YEAR ) { tenorCode = TenorCode . MONTH ; unit *= MONTHS_IN_YEAR ; } return applyTenor ( tenorCode , unit ) ; }
move the current date by a given tenor this means that if a date is either a weekend or holiday it will be skipped acording to the holiday handler and not count towards the number of days to move .