FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gridlab-d/java/GProperty.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
/
GProperty.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (54 loc) · 1.98 KB
Breadcrumbs
gridlab-d
/
java
/
GProperty.java
Copy path
File metadata and controls
56 lines (54 loc) · 1.98 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
package
gridlabd
;
/**
* An extensible class that mirrors the struct PROPERTY in the GridLAB-D core. Used in GObject,
* but little is done with this class beyond struct-like behavior. Primarily for internal use and
* passing a property address to GridLAB-D core calls.
* @author Matthew Hauer <matthew.hauer@pnl.gov>
*/
public
class
GProperty
{
private
String
name
;
/** Name of this property*/
private
String
type
;
/** Name of the type of this property (see GridlabD.proptype) */
private
long
size
;
/** Estimated size of this property, in bytes. */
private
long
offset
;
/** Estimated offset within the OBJECT data block in C for this property, in bytes */
private
long
addr
;
/** Pointer to the */
public
String
GetName
(){
return
name
;}
public
String
GetType
(){
return
type
;}
public
long
GetSize
(){
return
size
;}
public
long
GetOffset
(){
return
offset
;}
public
long
GetAddr
(){
return
addr
;}
private
GProperty
(
String
n
,
String
t
,
long
s
,
long
o
){
name
=
new
String
(
n
);
type
=
new
String
(
t
);
size
=
s
;
offset
=
o
;
}
/**
* Public constructor wrapper.
* @param n Name of the property to create.
* @param t Name of the type of property to create.
* @param o Offset for this property, in bytes.
* @return The new GProperty object, null if the property type was invalid.
*/
public
static
GProperty
Build
(
String
n
,
String
t
,
long
o
){
Long
size
=
GridlabD
.
proptype
.
get
(
t
);
GProperty
p
=
null
;
if
(
size
==
null
){
GridlabD
.
error
(
"Unable to create property
\"
"
+
n
+
"
\"
of type
\"
"
+
t
+
"
\"
"
);
return
null
;
}
p
=
new
GProperty
(
n
,
t
,
size
.
longValue
(),
o
);
//p.addr = GridlabD.find_property();
return
p
;
}
/**
* Public constructor wrapper.
* @param n Name of the property to create.
* @param t Name of the type of property to create.
* @param o Offset for this property, in bytes.
* @param s Size of this property, in bytes.
* @return The new GProperty object
*/
public
static
GProperty
Build
(
String
n
,
String
t
,
long
o
,
long
s
){
return
new
GProperty
(
n
,
t
,
s
,
o
);
}
}
Back
|
FazBrowse Home
|
New Git URL