FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gridlab-d/java/GModule.java at master · INFERLab/gridlab-d · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
INFERLab
/
gridlab-d
Public
forked from
gridlab-d/gridlab-d
Notifications
You must be signed in to change notification settings
Fork
2
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
gridlab-d
/
java
/
GModule.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (62 loc) · 1.78 KB
Breadcrumbs
gridlab-d
/
java
/
GModule.java
Copy path
File metadata and controls
65 lines (62 loc) · 1.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
gridlabd
;
import
java
.
util
.
Hashtable
;
/**
* The base representation of a GridLAB-D MODULE struct. Should be incorporated into Java
* GridLAB-D modules, whether with composition or (preferably) inheritence.
* @author Matthew Hauer <matthew.hauer@pnl.gov>
*/
public
class
GModule
{
protected
String
name
;
protected
long
addr
;
protected
Hashtable
<
String
,
GClass
>
ctable
=
new
Hashtable
<
String
,
GClass
>();
public
long
GetFirstClassAddr
(){
if
(
ctable
.
isEmpty
())
return
0
;
return
ctable
.
elements
().
nextElement
().
GetClassAddr
();
}
public
GModule
(
long
a
,
String
n
){
addr
=
a
;
name
=
new
String
(
n
);
}
public
int
AddClass
(
GClass
gc
){
if
(!
ctable
.
containsKey
(
gc
.
GetClassname
())){
ctable
.
put
(
new
String
(
gc
.
GetClassname
()),
gc
);
return
1
;
}
GridlabD
.
error
(
"Module "
+
name
+
" already contains class "
+
gc
.
GetClassname
());
return
0
;
}
public
long
GetAddr
(){
return
addr
;}
public
String
GetName
(){
return
new
String
(
name
);}
/* the module has been allocated in C already, we just need to fill it in on this side */
public
final
static
GModule
init
(
long
mod_addr
,
String
mod_name
,
int
argc
,
String
[]
argv
){
GModule
mod
=
new
GModule
(
mod_addr
,
mod_name
);
return
mod
;
}
public
final
static
int
do_kill
(){
// if anything needs to be deleted or freed, this is a good time to do it
return
0
;
}
public
static
int
check
(){
return
0
;
}
public
static
int
import_file
(
String
filename
){
return
0
;
}
public
static
int
export_file
(
String
filename
){
return
0
;
}
public
static
int
setvar
(
String
varname
,
String
value
){
return
0
;
}
public
static
int
module_test
(
int
argc
,
String
[]
argv
){
return
0
;
}
public
static
int
cmdargs
(
int
argc
,
String
[]
argv
){
return
0
;
}
/* returns a string to fprintf into the C-side stub */
public
String
kmldump
(
long
object_addr
){
return
""
;
}
}
Back
|
FazBrowse Home
|
New Git URL