Skip to content

Commit

Permalink
#187 wrapping into SWE Elements
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 31, 2022
1 parent bf2e088 commit 1ad75dd
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export(geometaLogger)
export(geometa_coverage)
export(getClassesInheriting)
export(getGeometaOption)
export(getGeometaOptions)
export(getIANAMimeTypes)
export(getISOClasses)
export(getISOCodelist)
Expand Down
6 changes: 3 additions & 3 deletions R/SWECategory.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ SWECategory <- R6Class("SWECategory",
#'@description setCodeSpace
#'@param codeSpace codeSpace
setCodeSpace = function(codeSpace){
self$codeSpace <- codeSpace
self$codeSpace <- SWEElement$create(element = "codeSpace", value = codeSpace)
},

#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$create(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -68,7 +68,7 @@ SWECategory <- R6Class("SWECategory",
if(!is.character(value)){
stop("Value should be character")
}
self$value <- value
self$value <- SWEElement$create(element = "value", value = value)
}
)
)
6 changes: 3 additions & 3 deletions R/SWECategoryRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ SWECategoryRange <- R6Class("SWECategoryRange",
#'@description setCodeSpace
#'@param codeSpace codeSpace
setCodeSpace = function(codeSpace){
self$codeSpace <- codeSpace
self$codeSpace <- SWEElement$create(element = "codeSpace", value = codeSpace)
},

#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$create(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -78,7 +78,7 @@ SWECategoryRange <- R6Class("SWECategoryRange",
}else{
stop("Value should be either a vector or matrix")
}
self$value <- value
self$value <- SWEElement$create(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWECount.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SWECount <- R6Class("SWECount",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$create(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -56,7 +56,7 @@ SWECount <- R6Class("SWECount",
if(!is.integer(value)){
stop("Value should be integer")
}
self$value <- value
self$value <- SWEElement$create(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWECountRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SWECountRange <- R6Class("SWECountRange",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$create(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -67,7 +67,7 @@ SWECountRange <- R6Class("SWECountRange",
}else{
stop("Value should be either a vector or matrix")
}
self$value <- value
self$value <- SWEElement$create(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWEQuantity.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SWEQuantity <- R6Class("SWEQuantity",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$new(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -69,7 +69,7 @@ SWEQuantity <- R6Class("SWEQuantity",
if(!is.numeric(value)){
stop("Value should be numeric")
}
self$value <- value
self$value <- SWEElement$new(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWEQuantityRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SWEQuantityRange <- R6Class("SWEQuantityRange",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$new(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -80,7 +80,7 @@ SWEQuantityRange <- R6Class("SWEQuantityRange",
}else{
stop("Value should be either a vector or matrix")
}
self$value <- value
self$value <- SWEElement$new(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWEText.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ SWEText <- R6Class("SWEText",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$new(element = "constraint", value = constraint)
},

#'@description setValue
#'@param value value
setValue = function(value){
self$value <- value
self$value <- SWEElement$new(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWETime.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SWETime <- R6Class("SWETime",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$new(element = "constraint", value = constraint)
},

#'@description setValue
Expand All @@ -69,7 +69,7 @@ SWETime <- R6Class("SWETime",
if(!is(value,"Date") && !is(value, "POSIXt")){
stop("Value should be either a Date or POSIX object")
}
self$value <- value
self$value <- SWEElement$new(element = "value", value = value)
}
)
)
4 changes: 2 additions & 2 deletions R/SWETimeRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ SWETimeRange <- R6Class("SWETimeRange",
#'@description setConstraint
#'@param constraint constraint
setConstraint = function(constraint){
self$constraint <- constraint
self$constraint <- SWEElement$create(element = "constraint", value = constraint)
},

#'@description setValue
#'@param start start time
#'@param end end time
setValue = function(start, end){
self$value <- matrix(list(start, end), nrow = 1, ncol = 2, byrow = TRUE)
self$value <- SWEElement$create(element = "value", value = matrix(list(start, end), nrow = 1, ncol = 2, byrow = TRUE))
}
)
)
3 changes: 2 additions & 1 deletion R/geometa_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ getGeometaOption <- function(option){
#'@name getGeometaOptions
#'@aliases getGeometaOptions
#'@title getGeometaOptions
#' @description \code{getGeometaOptions} allows to get options from \pkg{geometa}
#'@description \code{getGeometaOptions} allows to get options from \pkg{geometa}
#'@export
#'
#' @usage getGeometaOptions()
#'
Expand Down

0 comments on commit 1ad75dd

Please sign in to comment.