net.finmath.marketdata.model.curves.AbstractCurve Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of finmath-lib Show documentation
Show all versions of finmath-lib Show documentation
finmath lib is a Mathematical Finance Library in Java.
It provides algorithms and methodologies related to mathematical finance.
/*
* (c) Copyright Christian P. Fries, Germany. All rights reserved. Contact: [email protected].
*
* Created on 17.02.2013
*/
package net.finmath.marketdata.model.curves;
import java.util.Calendar;
/**
* Abstract base class for a curve. It stores the name of the curve and
* provides some convenient way of getting values.
*
* @author Christian Fries
*/
public abstract class AbstractCurve implements CurveInterface, Cloneable {
private final Calendar referenceDate;
private final String name;
public AbstractCurve(String name, Calendar referenceDate) {
super();
this.name = name;
this.referenceDate = referenceDate;
}
/* (non-Javadoc)
* @see net.finmath.marketdata.model.curves.CurveInterface#getName()
*/
@Override
public String getName() {
return name;
}
public Calendar getReferenceDate() {
return referenceDate;
}
/* (non-Javadoc)
* @see net.finmath.marketdata.model.curves.CurveInterface#getValue(double)
*/
@Override
public double getValue(double time) {
return getValue(null, time);
}
/**
* Return a vector of values corresponding to a given vector of times.
* @param times A given vector of times.
* @return A vector of values corresponding to the given vector of times.
*/
public double[] getValues(double[] times) {
double[] values = new double[times.length];
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy