Coverage Report - net.objectlab.kit.datecalc.joda.LocalDateModifiedPrecedingHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
LocalDateModifiedPrecedingHandler
100%
3/3
N/A
1
 
 1  
 /*
 2  
  * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit.
 3  
  * 
 4  
  * Based in London, we are world leaders in the design and development 
 5  
  * of bespoke applications for the securities financing markets.
 6  
  * 
 7  
  * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
 8  
  *           ___  _     _           _   _          _
 9  
  *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
 10  
  *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
 11  
  *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
 12  
  *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
 13  
  *                   |__/
 14  
  *
 15  
  *                     www.ObjectLab.co.uk
 16  
  *
 17  
  * $Id: LocalDateModifiedPreceedingHandler.java 203 2006-10-11 12:53:07Z benoitx $
 18  
  * 
 19  
  * Copyright 2006 the original author or authors.
 20  
  *
 21  
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 22  
  * use this file except in compliance with the License. You may obtain a copy of
 23  
  * the License at
 24  
  *
 25  
  * http://www.apache.org/licenses/LICENSE-2.0
 26  
  *
 27  
  * Unless required by applicable law or agreed to in writing, software
 28  
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 29  
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 30  
  * License for the specific language governing permissions and limitations under
 31  
  * the License.
 32  
  */
 33  
 package net.objectlab.kit.datecalc.joda;
 34  
 
 35  
 import net.objectlab.kit.datecalc.common.DateCalculator;
 36  
 import net.objectlab.kit.datecalc.common.HolidayHandlerType;
 37  
 
 38  
 import org.joda.time.LocalDate;
 39  
 
 40  
 /**
 41  
  * A modified preceding handler will move the date backward if it falls on a
 42  
  * non working day BUT, if the new date falls into another month, it will revert
 43  
  * to moving forward until it finds a working day.
 44  
  * 
 45  
  * @author Benoit Xhenseval
 46  
  * @author $LastChangedBy: benoitx $
 47  
  * @version $Revision: 203 $ $Date: 2006-10-11 13:53:07 +0100 (Wed, 11 Oct 2006) $
 48  
  * 
 49  
  */
 50  91
 public class LocalDateModifiedPrecedingHandler extends LocalDateModifiedFollowingHandler {
 51  
 
 52  
     /**
 53  
      * Give the type name for this algorithm.
 54  
      * 
 55  
      * @return algorithm name.
 56  
      */
 57  
     @Override
 58  
     public String getType() {
 59  11
         return HolidayHandlerType.MODIFIED_PRECEDING;
 60  
     }
 61  
 
 62  
     /**
 63  
      * If the current date of the give calculator is a non-working day, it will
 64  
      * be moved according to the algorithm implemented.
 65  
      * 
 66  
      * @param calculator
 67  
      *            the calculator
 68  
      * @return the date which may have moved.
 69  
      */
 70  
     @Override
 71  
     public LocalDate moveCurrentDate(final DateCalculator<LocalDate> calculator) {
 72  78
         return move(calculator, -1);
 73  
     }
 74  
 }
 75  
 
 76  
 /*
 77  
  * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit.
 78  
  * 
 79  
  * Based in London, we are world leaders in the design and development 
 80  
  * of bespoke applications for the securities financing markets.
 81  
  * 
 82  
  * <a href="http://www.objectlab.co.uk/open">Click here to learn more about us</a>
 83  
  *           ___  _     _           _   _          _
 84  
  *          / _ \| |__ (_) ___  ___| |_| |    __ _| |__
 85  
  *         | | | | '_ \| |/ _ \/ __| __| |   / _` | '_ \
 86  
  *         | |_| | |_) | |  __/ (__| |_| |__| (_| | |_) |
 87  
  *          \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
 88  
  *                   |__/
 89  
  *
 90  
  *                     www.ObjectLab.co.uk
 91  
  */