Permalink
Browse files

example of mutator pattern

  • Loading branch information...
1 parent 2e5403b commit ceccebc433138423d6340e126f4c4251259cfc5f @jiwalker-usgs committed Feb 25, 2014
Showing with 5 additions and 5 deletions.
  1. +1 −1 NAMESPACE
  2. +4 −4 R/setAlgorithm.R
View
@@ -7,7 +7,7 @@ exportMethods(getAttributes)
exportMethods(getDataIDs)
exportMethods(getShapefiles)
exportMethods(getValues)
-exportMethods(setAlgorithm)
+exportMethods("setAlgorithm<-")
exportMethods(setFeature)
exportMethods(setProcessInputs)
exportMethods(setWFS)
View
@@ -12,15 +12,15 @@
#'"gov.usgs.cida.gdp.wps.algorithm.FeatureWeightedGridStatisticsAlgorithm")
#'gk <- setAlgorithm(gk,algorithm)
#'@export
-setGeneric(name="setAlgorithm",def=function(.Object,algorithm){standardGeneric("setAlgorithm")})
+setGeneric(name="setAlgorithm<-",def=function(.Object,value){standardGeneric("setAlgorithm<-")})
# '@rdname setAlgorithm-methods
# '@aliases setAlgorithm,geoknife-method
-setMethod(f = "setAlgorithm",signature = "geoknife",
- definition = function(.Object,algorithm){
- .Object@algorithm <- algorithm
+setReplaceMethod(f = "setAlgorithm",signature = "geoknife",
+ definition = function(.Object,value){
+ .Object@algorithm <- value
# now, initialize posts
.Object <- initializeProcessInputs(.Object)
return(.Object)

0 comments on commit ceccebc

Please sign in to comment.