remake for new project - finished CSV reader and format for USER class
This commit is contained in:
1 parent
5b6028e3b9
commit
e6db06dd8b
3 files changed
+31
-9
No files matched your search
@@ -4,6 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
package userprofilebuilder;
|
package userprofilebuilder;
|
||||||
|
|
||||||
|
import userprofilebuilder.model.User;
|
||||||
import userprofilebuilder.view.MainViewer;
|
import userprofilebuilder.view.MainViewer;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -26,8 +27,9 @@ public class App {
|
|||||||
try (BufferedReader reader = new BufferedReader(new FileReader("userprofile.csv"))) {
|
try (BufferedReader reader = new BufferedReader(new FileReader("userprofile.csv"))) {
|
||||||
while (reader.ready()) {
|
while (reader.ready()) {
|
||||||
String line = reader.readLine();
|
String line = reader.readLine();
|
||||||
String[] splitter = line.split(",");
|
String[] split = line.split(",");
|
||||||
|
User hi = new User(split[0], split[1], split[2], split[3]);
|
||||||
|
// add user to SINGLETON user group...
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
package userprofilebuilder.model;
|
package userprofilebuilder.model;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.FileReader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author
|
* @author
|
||||||
@@ -14,17 +11,33 @@ import java.io.FileReader;
|
|||||||
*/
|
*/
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private String profile;
|
private String Profile;
|
||||||
private String Title;
|
private String Title;
|
||||||
private String Username;
|
private String Username;
|
||||||
private String Email;
|
private String Email;
|
||||||
|
|
||||||
|
|
||||||
|
public User(String profile, String title, String username, String email)
|
||||||
|
{
|
||||||
|
this.Profile = profile;
|
||||||
|
this.Title = title;
|
||||||
|
this.Username = username;
|
||||||
|
this.Email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getProfile() {
|
public String getProfile() {
|
||||||
return profile;
|
return Profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProfile(String profile) {
|
public void setProfile(String profile) {
|
||||||
this.profile = profile;
|
this.Profile = profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
|
|||||||
@@ -14,10 +14,17 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public class UserGroup {
|
public class UserGroup {
|
||||||
|
|
||||||
|
public ArrayList<User> users;
|
||||||
|
|
||||||
public UserGroup()
|
public UserGroup()
|
||||||
{
|
{
|
||||||
ArrayList<User> users = new ArrayList<>();
|
users = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addUser(User user)
|
||||||
|
{
|
||||||
|
users.add(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user