Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Homework 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSE156 Group
Homework 2
Commits
c5947e9c
Commit
c5947e9c
authored
10 years ago
by
Russell Furnas Kaup
Browse files
Options
Downloads
Patches
Plain Diff
DataConverter
parent
5bcfc9c6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Assignment2/.classpath
+2
-0
2 additions, 0 deletions
Assignment2/.classpath
Assignment2/src/assignment2/Address.java
+1
-1
1 addition, 1 deletion
Assignment2/src/assignment2/Address.java
Assignment2/src/assignment2/DataConverter.java
+42
-13
42 additions, 13 deletions
Assignment2/src/assignment2/DataConverter.java
with
45 additions
and
14 deletions
Assignment2/.classpath
+
2
−
0
View file @
c5947e9c
...
...
@@ -3,5 +3,7 @@
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
exported=
"true"
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER"
/>
<classpathentry
kind=
"lib"
path=
"/home/raku/Desktop/xstream-1.4.7.jar"
/>
<classpathentry
kind=
"lib"
path=
"/home/raku/Desktop/xmlpull-1.1.3.1.jar"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
This diff is collapsed.
Click to expand it.
Assignment2/src/assignment2/Address.java
+
1
−
1
View file @
c5947e9c
...
...
@@ -5,7 +5,7 @@ public class Address {
String
city
;
String
state
;
String
zip
;
String
country
;
String
country
;
//git sucks
Address
(
String
street
,
String
city
,
String
state
,
String
zip
,
String
country
)
{
this
.
street
=
street
;
...
...
This diff is collapsed.
Click to expand it.
Assignment2/src/assignment2/DataConver
e
ter.java
→
Assignment2/src/assignment2/DataConverter.java
+
42
−
13
View file @
c5947e9c
...
...
@@ -3,8 +3,11 @@ package assignment2;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.util.Scanner
;
import
com.thoughtworks.xstream.*
;
public
class
DataConvereter
{
public
class
DataConverter
{
private
Customer
[]
customerArray
;
public
void
readPerson
()
{
...
...
@@ -15,7 +18,11 @@ public class DataConvereter {
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
int
size
=
Integer
.
parseInt
(
s
.
nextLine
());
Person
[]
personArray
;
personArray
=
new
Person
[
size
];
for
(
int
i
=
0
;
i
<
size
;
i
++){
String
personTemp
=
s
.
nextLine
();
String
[]
parts
=
personTemp
.
split
(
";"
);
...
...
@@ -23,7 +30,7 @@ public class DataConvereter {
String
name
=
parts
[
1
];
String
address
=
parts
[
2
];
String
eMail
=
parts
[
3
];
new
Person
(
personCode
,
name
,
address
,
eMail
);
personArray
[
i
]
=
new
Person
(
personCode
,
name
,
address
,
eMail
);
}
s
.
close
();
}
...
...
@@ -36,7 +43,11 @@ public class DataConvereter {
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
int
size
=
Integer
.
parseInt
(
s
.
nextLine
());
Venues
[]
venuesArray
;
venuesArray
=
new
Venues
[
size
];
for
(
int
i
=
0
;
i
<
size
;
i
++){
String
venueTemp
=
s
.
nextLine
();
String
[]
parts
=
venueTemp
.
split
(
";"
);
...
...
@@ -44,7 +55,7 @@ public class DataConvereter {
String
name
=
parts
[
1
];
String
address
=
parts
[
2
];
int
capacity
=
Integer
.
parseInt
(
parts
[
3
]);
new
Venues
(
venueCode
,
name
,
address
,
capacity
);
venuesArray
[
i
]
=
new
Venues
(
venueCode
,
name
,
address
,
capacity
);
}
s
.
close
();
}
...
...
@@ -58,6 +69,8 @@ public class DataConvereter {
e
.
printStackTrace
();
}
int
size
=
Integer
.
parseInt
(
s
.
nextLine
());
//up top for testing implementation
customerArray
=
new
Customer
[
size
];
for
(
int
i
=
0
;
i
<
size
;
i
++){
String
customerTemp
=
s
.
nextLine
();
String
[]
parts
=
customerTemp
.
split
(
";"
);
...
...
@@ -66,7 +79,7 @@ public class DataConvereter {
String
primaryContact
=
parts
[
2
];
String
name
=
parts
[
3
];
String
address
=
parts
[
4
];
new
Customer
(
customerCode
,
type
,
primaryContact
,
name
,
address
);
customerArray
[
i
]
=
new
Customer
(
customerCode
,
type
,
primaryContact
,
name
,
address
);
}
s
.
close
();
}
...
...
@@ -121,6 +134,22 @@ public class DataConvereter {
s
.
close
();
}
private
String
serializeObjects
(
Object
obj
)
{
XStream
xstream
=
new
XStream
();
String
xml
=
null
;
return
xml
;
}
private
String
serializeObjects
(
Person
[]
per
[])
{
XStream
xstream
=
new
XStream
();
String
xml
=
null
;
return
xml
;
}
public
static
void
main
(
String
args
[])
{
serializeObjects
(
readProduct
().)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment