-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSignal.R
More file actions
40 lines (36 loc) · 1.34 KB
/
Signal.R
File metadata and controls
40 lines (36 loc) · 1.34 KB
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
#################################################################################################
# Name of file Signal.R #
# Creation Date 05/05/2014 #
# last modification 29/05/2014 #
# Version 2.0 #
# @author Djedou Zakaria #
#################################################################################################
.Signal.valid <- function(object){ return(TRUE)}
setClass (
Class ="Signal",
representation= representation(val="numeric"),
validity =.Signal.valid
)
rm (.Signal.valid )
## Getteurs
setMethod( f ="[",signature ="Signal",
definition = function(x,i,j,drop){
switch(EXPR=i,
"val"={return(x@val)},
stop("this attribute does not exist!")
)
}
)
## Setteurs
setReplaceMethod(
f ="[",
signature ="Signal",
definition = function(x,i,j,value){
switch(EXPR=i,
"val"={x@val <-value},
stop("this attribute does not exist!")
)
validObject (x)
return(x)
}
)