2日目段階7です
This commit is contained in:
@@ -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,6 +71,14 @@ 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()
|
||||
@@ -89,4 +99,8 @@ public class EmployeeData extends BaseData {
|
||||
public String getPrimaryKeyValue() {
|
||||
return idEmployee;
|
||||
}
|
||||
|
||||
public static int empCount() {
|
||||
return empCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public class Main {
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user