Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_mszczonow_1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
alx_mszczonow_1
Commits
bf433547
Commit
bf433547
authored
Jul 10, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ObslugaCSV - poprawiona wersja
parent
e42a5d52
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
ObslugaCSV.java
src/main/java/emps/ObslugaCSV.java
+2
-1
P0_WypiszObiekty.java
src/main/java/emps/P0_WypiszObiekty.java
+13
-0
No files found.
src/main/java/emps/ObslugaCSV.java
View file @
bf433547
...
...
@@ -13,9 +13,10 @@ public class ObslugaCSV {
public
static
List
<
Employee
>
wczytaj
(
String
sciezka
)
{
List
<
Employee
>
emps
=
new
ArrayList
<>();
try
(
BufferedReader
reader
=
new
BufferedReader
(
new
FileReader
(
sciezka
)))
{
reader
.
readLine
();
// tylko po to, aby pominąć pierwszą linię
String
linia
;
while
((
linia
=
reader
.
readLine
())
!=
null
)
{
String
[]
t
=
linia
.
split
(
";"
);
String
[]
t
=
linia
.
split
(
";"
,
-
1
);
Employee
emp
=
new
Employee
(
Integer
.
parseInt
(
t
[
0
]),
t
[
1
],
t
[
2
],
t
[
3
],
Integer
.
parseInt
(
t
[
4
]),
LocalDate
.
parse
(
t
[
5
]),
t
[
6
],
t
[
7
],
t
[
8
],
t
[
9
],
t
[
10
]);
...
...
src/main/java/emps/P0_WypiszObiekty.java
0 → 100644
View file @
bf433547
package
emps
;
import
java.util.List
;
public
class
P0_WypiszObiekty
{
public
static
void
main
(
String
[]
args
)
{
List
<
Employee
>
emps
=
ObslugaCSV
.
wczytaj
(
"pliki/emps.csv"
);
System
.
out
.
println
(
"Liczba rekordów: "
+
emps
.
size
());
for
(
Employee
emp
:
emps
)
{
System
.
out
.
println
(
emp
);
}
}
}
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