R/cashflow.R

Defines functions Cashflow IsCashflow

setClass(
    Class          = "Cashflow",
    representation = representation(
        maturity = "numeric",
        value    = "numeric"
    )
)

Cashflow <- function(maturity, value) {
    new(Class    = "Cashflow",
        maturity = maturity,
        value    = value)
}

IsCashflow <- function(x) is(x, "Cashflow")

setMethod(
    f          = "Chart",
    signature  = "Cashflow",
    definition = function(object, ...) {
        pplot(x    = object@maturity,
              y    = object@value,
              type = "h",
              ...)
    }
)
gfunk0704/StochasticVolatility documentation built on Feb. 8, 2020, 10:04 a.m.