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.

There is a newer version: 6.0.19
Show newest version
/*
 * (c) Copyright Christian P. Fries, Germany. All rights reserved. Contact: [email protected].
 *
 * Created on 07.09.2013
 */

package net.finmath.time.daycount;

import java.util.Calendar;

/**
 * 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 DayCountConventionInterface}.
 * 
 * @author Christian Fries
 */
public class DayCountConvention_NONE implements DayCountConventionInterface {

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy