-
Notifications
You must be signed in to change notification settings - Fork 5
/
GMLOperationParameterGroup.R
83 lines (78 loc) · 2.89 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#' 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.
#'
#' @field maximumOccurs [\code{\link{GMLElement}}]
#' @field parameter [\code{\link{GMLOperationParameter}}|\code{\link{GMLOperationParameterGroup}}]
#'
#' @section Inherited methods:
#' from \code{GMLAbstractGeneralOperationParameter}
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, defaults, id)}}{
#' This method is used to instantiate a GML OperationParameterGroup
#' }
#' \item{\code{setMaximumOccurs(maximumOccurs)}}{
#' Sets the maximum occurs, object of class \code{integer}
#' }
#' \item{\code{addParameter(parameter)}}{
#' Adds a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroup}
#' }
#' \item{\code{delParameter(parameter)}}{
#' Deletes a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroupo}
#' }
#' }
#'
#' @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(
#+ maximumOccurs [0..1]: integer
maximumOccurs = NULL,
#+ parameter [2..*]: GMLOperationParameter / GMLOperationParameterGroup
parameter = list(),
#setMaximumOccurs
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)
},
#addParameter
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))
},
#delParameter
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))
}
)
)