All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.finmath.time.daycount.DayCountConvention_NONE Maven / Gradle / Ivy

Go to download

finmath lib is a Mathematical Finance Library in Java. It provides algorithms and methodologies related to mathematical finance.

The newest version!
/*
 * (c) Copyright Christian P. Fries, Germany. Contact: [email protected].
 *
 * Created on 07.09.2013
 */

package net.finmath.time.daycount;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * This is a special day count convention, where the day count between two dates is always 0.0
 * and the year fraction for an interval is always 1.0.
 *
 * The latter property is probably the relevant property: you may use this day count convention if a coupon period
 * pays the coupon without applying a year fraction of the accrual period, but the implementation requires an object implementing
 * {@link DayCountConvention}.
 *
 * @author Christian Fries
 * @version 1.0
 */
public class DayCountConvention_NONE implements DayCountConvention, Serializable {

	private static final long serialVersionUID = 1234679674480984332L;

	/**
	 * Create a day count convention with a constant year fraction of 1.0 for all periods.
	 */
	public DayCountConvention_NONE() {
	}

	@Override
	public double getDaycount(final LocalDate startDate, final LocalDate endDate) {
		return 0.0;
	}

	@Override
	public double getDaycountFraction(final LocalDate startDate, final LocalDate endDate) {
		return 1.0;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy