Minor cosmetic changes to AnalyticalModel
added toString() method
corrected typo in volatilitySufaceMap
@@ -31,7 +31,7 @@ import net.finmath.marketdata.model.volatilities.VolatilitySurfaceInterface;
public class AnalyticModel implements AnalyticModelInterface, Cloneable {
private final Map<String, CurveInterface> curvesMap = new HashMap<String, CurveInterface>();
- private final Map<String, VolatilitySurfaceInterface> volatilitySufaceMap = new HashMap<String, VolatilitySurfaceInterface>();
+ private final Map<String, VolatilitySurfaceInterface> volatilitySurfaceMap = new HashMap<String, VolatilitySurfaceInterface>();
/**
* Create an empty analytic model.
@@ -140,13 +140,13 @@ public class AnalyticModel implements AnalyticModelInterface, Cloneable {
@Override
public VolatilitySurfaceInterface getVolatilitySurface(String name) {
- return volatilitySufaceMap.get(name);
+ return volatilitySurfaceMap.get(name);
}
public AnalyticModelInterface addVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
{
AnalyticModel newModel = clone();
- newModel.volatilitySufaceMap.put(volatilitySurface.getName(), volatilitySurface);
+ newModel.volatilitySurfaceMap.put(volatilitySurface.getName(), volatilitySurface);
return newModel;
}
@@ -154,14 +154,14 @@ public class AnalyticModel implements AnalyticModelInterface, Cloneable {
public AnalyticModelInterface addVolatilitySurfaces(VolatilitySurfaceInterface... volatilitySurfaces)
{
AnalyticModel newModel = clone();
- for(VolatilitySurfaceInterface volatilitySurface : volatilitySurfaces) newModel.volatilitySufaceMap.put(volatilitySurface.getName(), volatilitySurface);
+ for(VolatilitySurfaceInterface volatilitySurface : volatilitySurfaces) newModel.volatilitySurfaceMap.put(volatilitySurface.getName(), volatilitySurface);
return newModel;
}
@Override
public AnalyticModelInterface addVolatilitySurfaces(Set<AbstractVolatilitySurface> volatilitySurfaces) {
AnalyticModel newModel = clone();
- for(VolatilitySurfaceInterface volatilitySurface : volatilitySurfaces) newModel.volatilitySufaceMap.put(volatilitySurface.getName(), volatilitySurface);
+ for(VolatilitySurfaceInterface volatilitySurface : volatilitySurfaces) newModel.volatilitySurfaceMap.put(volatilitySurface.getName(), volatilitySurface);
return newModel;
}
@@ -172,7 +172,7 @@ public class AnalyticModel implements AnalyticModelInterface, Cloneable {
@Deprecated
public void setVolatilitySurface(VolatilitySurfaceInterface volatilitySurface)
{
- volatilitySufaceMap.put(volatilitySurface.getName(), volatilitySurface);
+ volatilitySurfaceMap.put(volatilitySurface.getName(), volatilitySurface);
}
private void set(Object marketDataObject) {
@@ -186,7 +186,7 @@ public class AnalyticModel implements AnalyticModelInterface, Cloneable {
{
AnalyticModel newModel = new AnalyticModel();
newModel.curvesMap.putAll(curvesMap);
- newModel.volatilitySufaceMap.putAll(volatilitySufaceMap);
+ newModel.volatilitySurfaceMap.putAll(volatilitySurfaceMap);
return newModel;
}
@@ -216,4 +216,9 @@ public class AnalyticModel implements AnalyticModelInterface, Cloneable {
}
return hazardCurve;
}
+
+ @Override
+ public String toString() {
+ return "AnalyticModel: curves=" + curvesMap.keySet() + ", volatilitySurfaces=" + volatilitySurfaceMap.keySet();
+ }
}
