R/AAPoint.R

setClass("Point", representation(x = "numeric", y = "numeric", 
  z = "numeric"), prototype = list(z = 0), contains = "SBase")

setMethod("describe", "Point", function(object) {
  paste("(", paste(x(object), y(object), z(object), sep = ", "), ")", sep = "")
})

 setGeneric("x", function(object) standardGeneric("x"))
setMethod("x", "Point", function(object) object@x)

 setGeneric("y", function(object) standardGeneric("y"))
setMethod("y", "Point", function(object) object@y)

 setGeneric("z", function(object) standardGeneric("z"))
setMethod("z", "Point", function(object) object@z)

 setGeneric("x<-", function(object, value) standardGeneric("x<-"))
setReplaceMethod("x", "Point", function(object, value) {
  object@x <- value
  object
})

 setGeneric("y<-", function(object, value) standardGeneric("y<-"))
setReplaceMethod("y", "Point", function(object, value) {
  object@y <- value
  object
})

 setGeneric("z<-", function(object, value) standardGeneric("z<-"))
setReplaceMethod("z", "Point", function(object, value) {
  object@z <- value
  object
})

Try the rsbml package in your browser

Any scripts or data that you put into this service are public.

rsbml documentation built on Nov. 8, 2020, 8:09 p.m.