setClass("shape", representation(x="numeric", y="numeric"), prototype(x=0, y=0) ) # accessors for x & y setGeneric("getX", function(this) standardGeneric("getX")) setMethod("getX", "shape", function(this) { this@x } ) setGeneric("getY", function(this) standardGeneric("getY")) setMethod("getY", "shape", function(this) { this@y } ) setGeneric("setX<-", function(this, value) standardGeneric("setX<-")
{{#tags}}- {{label}}
{{/tags}}