FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RecRankJavaEmersion/src/ConstructGroum.java at master · coderZMR/RecRankJavaEmersion · GitHub
coderZMR
/
RecRankJavaEmersion
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
RecRankJavaEmersion
/
src
/
ConstructGroum.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
75 lines (70 loc) · 3.18 KB
Breadcrumbs
RecRankJavaEmersion
/
src
/
ConstructGroum.java
Copy path
File metadata and controls
executable file
·
75 lines (70 loc) · 3.18 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
66
67
68
69
70
71
72
73
74
75
import
java
.
io
.
BufferedReader
;
import
java
.
io
.
FileReader
;
import
java
.
util
.
HashMap
;
import
java
.
util
.
Map
;
public
class
ConstructGroum
{
public
Groum
constructGroum
(
String
groumPath
,
Map
<
String
,
String
>
apiMap
){
Groum
groum
=
new
Groum
();
try
{
BufferedReader
br
=
new
BufferedReader
(
new
FileReader
(
groumPath
));
String
line
=
null
;
while
((
line
=
br
.
readLine
()) !=
null
){
if
(
line
.
endsWith
(
"]"
)){
line
=
line
.
replace
(
"["
,
""
);
line
=
line
.
replace
(
"]"
,
""
);
String
[]
strs
=
line
.
split
(
" "
);
String
id
=
strs
[
0
];
String
api
=
strs
[
1
].
replace
(
"label=
\"
"
,
""
);
api
=
api
.
substring
(
0
,
api
.
length
() -
1
);
if
(!
api
.
startsWith
(
"/home/x/mydisk/download_high_repos"
)){
String
originApi
=
api
;
if
(
originApi
.
contains
(
"<"
)){
if
(
originApi
.
contains
(
"<init>"
)){
originApi
=
originApi
.
replaceAll
(
"<init>"
,
"chenchichenchi"
);
}
originApi
=
originApi
.
replaceAll
(
"
\\
<.*?
\\
>"
,
""
);
originApi
=
originApi
.
replaceAll
(
">"
,
""
);
if
(
originApi
.
contains
(
"chenchichenchi"
)){
originApi
=
originApi
.
replaceAll
(
"chenchichenchi"
,
"<init>"
);
}
}
if
(
apiMap
.
containsKey
(
originApi
)){
api
=
apiMap
.
get
(
originApi
);
}
else
{
api
=
Integer
.
toString
(-
1
);
}
// String startLineString = strs[strs.length - 2].replace("startLine=","");
// String endLineString = strs[strs.length - 1].replace("endLine=","");
// int startLine = Integer.parseInt(startLineString);
// int endLine = Integer.parseInt(endLineString);
// GroumNode node = new GroumNode(id,api,originApi,startLine,endLine);
if
(!
api
.
equals
(
"-1"
)) {
GroumNode
node
=
new
GroumNode
(
id
,
api
,
originApi
, -
1
, -
1
);
groum
.
addNode
(
node
);
}
}
}
else
if
(
line
.
endsWith
(
";"
)){
line
=
line
.
replace
(
"[label=
\"
\"
];"
,
""
);
line
=
line
.
trim
();
String
[]
strs
=
line
.
split
(
" -> "
);
if
(
strs
.
length
==
2
) {
String
parentNodeId
=
strs
[
0
];
String
childNodeId
=
strs
[
1
];
if
(
groum
.
getNodeMap
().
containsKey
(
parentNodeId
) &&
groum
.
getNodeMap
().
containsKey
(
childNodeId
)) {
groum
.
addEdge
(
parentNodeId
,
childNodeId
);
}
}
}
}
br
.
close
();
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
null
;
}
catch
(
Error
e
){
e
.
printStackTrace
();
return
null
;
}
return
groum
;
}
}
Back
|
FazBrowse Home
|
New Git URL