2日目段階7です

This commit is contained in:
2026-09-24 15:28:04 +09:00
parent a7ab96fe7d
commit 83691c5691
2 changed files with 23 additions and 8 deletions

View File

@@ -6,9 +6,10 @@ public class EmployeeData extends BaseData {
private String mailAddress;
private String password;
private String idDepartment;
private static int empCount = 0;
EmployeeData() {
empCount = empCount + 1;
}
EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password,
@@ -19,6 +20,7 @@ public class EmployeeData extends BaseData {
setMailAddress(mailAddress);
setPassword(password);
setIdDepartment(idDepartment);
empCount = empCount + 1;
}
public String getIdEmployee() {
@@ -69,17 +71,25 @@ public class EmployeeData extends BaseData {
this.idDepartment = idDepartment;
}
public static int getEmpCount() {
return empCount;
}
public static void setEmpCount(int empCount) {
EmployeeData.empCount = empCount;
}
@Override
public String toString() {
return getIdEmployee() + "\t" + getNmEmployee() + "\t" + getKnEmployee() + "\t" + getMailAddress()
+ "\t" + getPassword() + "\t" + getIdDepartment();
}
// public boolean isMatchId(String id) {
//
// return idEmployee.equals(id);
//
// }
// public boolean isMatchId(String id) {
//
// return idEmployee.equals(id);
//
// }
public String toCSV() {
return getIdEmployee() + "," + getNmEmployee() + "," + getKnEmployee() + "," + getMailAddress()
@@ -89,4 +99,8 @@ public class EmployeeData extends BaseData {
public String getPrimaryKeyValue() {
return idEmployee;
}
public static int empCount() {
return empCount;
}
}

View File

@@ -43,10 +43,11 @@ public class Main {
allData[8] = dept3;
allData[9] = dept4;
allData[10] = dept5;
for (int i = 0; i < allData.length; i++) {
System.out.println(allData[i]);
}
System.out.println("現在の社員データ件数"+ EmployeeData.getEmpCount()+ "件");
for (int i = 0; i < allData.length; i++) {
@@ -55,7 +56,7 @@ public class Main {
bo = true;
System.out.println(allData[i]);
// System.out.println(employee.toCSV(F));
// System.out.println(employee.toCSV());
// System.out.println(employee.getPrimaryKeyValue());
}