Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
trh010
cs311_final_project
Commits
3c93c62b
Commit
3c93c62b
authored
Apr 15, 2014
by
trh010
Browse files
Trying to figure out input file path
parent
866d4940
Changes
5
Hide whitespace changes
Inline
Side-by-side
CS311_final_project/src/
test/
5lw-m.dat
→
CS311_final_project/src/5lw-m.dat
View file @
3c93c62b
File moved
CS311_final_project/src/
test/
5lw-s.dat
→
CS311_final_project/src/5lw-s.dat
View file @
3c93c62b
File moved
CS311_final_project/src/
test/
5lw.dat
→
CS311_final_project/src/5lw.dat
View file @
3c93c62b
File moved
CS311_final_project/src/main/AdjacencyList.java
View file @
3c93c62b
package
main
;
package
main
;
import
java.util.ArrayList
;
public
class
AdjacencyList
{
public
class
AdjacencyList
{
private
ArrayList
<
ArrayList
<
String
>>
adjList
;
public
AdjacencyList
(){
adjList
=
new
ArrayList
<
ArrayList
<
String
>>();
}
}
}
CS311_final_project/src/main/Main.java
View file @
3c93c62b
...
@@ -5,18 +5,28 @@ import java.io.FileNotFoundException;
...
@@ -5,18 +5,28 @@ import java.io.FileNotFoundException;
import
java.util.Scanner
;
import
java.util.Scanner
;
public
class
Main
{
public
class
Main
{
public
static
void
main
(
String
[]
args
){
AdjacencyList
adjList
;
//reads args[0] for input file path
public
Main
(){
File
file
=
new
File
(
args
[
0
]);
adjList
=
new
AdjacencyList
();
}
public
void
createGraph
(
String
path
){
File
file
=
new
File
(
path
);
try
{
try
{
Scanner
in
=
new
Scanner
(
file
);
Scanner
in
=
new
Scanner
(
file
);
System
.
out
.
println
(
in
.
next
());
in
.
close
();
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
System
.
err
.
println
(
"Error in opening the file: "
+
args
[
0
]
+
". Please check the file path."
);
System
.
err
.
println
(
"Error in opening the file: "
+
path
+
". Please check the file path."
);
}
}
}
public
static
void
main
(
String
[]
args
){
Main
main
=
new
Main
();
main
.
createGraph
(
args
[
0
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment