diff --git a/em-oop/src/EmployeeData.java b/em-oop/src/EmployeeData.java index 7950669..2802c9a 100644 --- a/em-oop/src/EmployeeData.java +++ b/em-oop/src/EmployeeData.java @@ -106,4 +106,13 @@ public class EmployeeData extends BaseDate { public String getPrimaryKeyValue() { return idEmployee; } + public boolean isMatchId(String id) { + System.out.println(id + "を検索します"); + if(id.equals(idEmployee)) { + return true; + } else { + return false; + + } + } } diff --git a/em-oop/src/Main.java b/em-oop/src/Main.java index d243b7b..f6cc3a9 100644 --- a/em-oop/src/Main.java +++ b/em-oop/src/Main.java @@ -11,14 +11,18 @@ public class Main { employee[4] = new EmployeeData("10004","三宅武","ミヤケタケシ","miya@hoge.jp","eee","14"); - for (int i=0; i<=4; i++ ) { - System.out.println(employee[i]); - } - int i=EmployeeData.getEmpCount(); - System.out.println("現在の社員データ件数;"+ i + "件"); - - System.out.println(employee[0].toCSV()); - System.out.println(employee[0].getPrimaryKeyValue()); +// for (int i=0; i<=4; i++ ) { +// System.out.println(employee[i]); +// } +// int i=EmployeeData.getEmpCount(); +// System.out.println("現在の社員データ件数;"+ i + "件"); +// +// System.out.println(employee[0].toCSV()); +// System.out.println(employee[0].getPrimaryKeyValue()); + + boolean bo= employee[0].isMatchId("10000"); + System.out.println(bo); + } }