-
Notifications
You must be signed in to change notification settings - Fork 1
/
File1.R
34 lines (32 loc) · 605 Bytes
/
File1.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
setOldClass("file")
File <- setClass("File",
contains = "file",
slots = c(path = "character")
)
setGeneric(name = "getFilePath",
def = function(theObject)
{
standardGeneric("getFilePath")
}
)
setMethod(f = "getFilePath",
signature = "File",
definition = function(theObject)
{
return(theObject@path)
}
)
setGeneric(name = "setFilePath",
def = function(theObject, new_path)
{
standardGeneric("setFilePath")
}
)
setMethod(f = "setFilePath",
signature = "File",
definition = function(theObject, new_path)
{
theObject@path <- new_path
return(theObject)
}
)