-
Notifications
You must be signed in to change notification settings - Fork 5
/
GMLOperationParameterGroup.R
64 lines (59 loc) · 2.5 KB
/
GMLOperationParameterGroup.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#' GMLOperationParameterGroup
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML operation parameter group
#' @return Object of \code{\link{R6Class}} for modelling an GMLOperationParameterGroup
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO 19136:2007 Geographic Information -- Geographic Markup Language.
#' http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554
#'
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
GMLOperationParameterGroup <- R6Class("GMLOperationParameterGroup",
inherit = GMLAbstractGeneralOperationParameter,
private = list(
xmlElement = "OperationParameterGroup",
xmlNamespacePrefix = "GML"
),
public = list(
#'@field maximumOccurs maximumOccurs [0..1]: integer
maximumOccurs = NULL,
#'@field parameter parameter [2..*]: GMLOperationParameter / GMLOperationParameterGroup
parameter = list(),
#'@description Set maximum occurs
#'@param maximumOccurs maximumOccurs, object of class \link{integer}
setMaximumOccurs = function(maximumOccurs){
if(!is(maximumOccurs, "integer")){
maximumOccurs <- as.integer(maximumOccurs)
if(is.na(maximumOccurs)){
stop("The argument value should be an object of class 'integer'")
}
}
self$maximumOccurs <- GMLElement$create("maximumOccurs", value = maximumOccurs)
},
#'@description Adds a parameter
#'@param param object of class \link{GMLOperationParameter} or \link{GMLOperationParameterGroup}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$addListElement("parameter", param))
},
#'@description Deletes a parameter
#'@param param object of class \link{GMLOperationParameter} or \link{GMLOperationParameterGroup}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$delListElement("parameter", param))
}
)
)