Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df6923ae4d | |||
| 94dfb97b76 | |||
| 77d3cbfcc6 |
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
|
|
||||||
<classpathentry kind="src" path="src/main/java"/>
|
|
||||||
<classpathentry kind="output" path="build/classes"/>
|
|
||||||
</classpath>
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
/build/
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<faceted-project>
|
|
||||||
<installed facet="java" version="21"/>
|
|
||||||
</faceted-project>
|
|
||||||
17
EmployeeData_20261014_hirayama.java
Normal file
17
EmployeeData_20261014_hirayama.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
public class EmployeeData {
|
||||||
|
//フィールド
|
||||||
|
String idEmployee;
|
||||||
|
String nmEmployee;
|
||||||
|
String knEmployee;
|
||||||
|
String mailAddress;
|
||||||
|
String password;
|
||||||
|
String idDepartment;
|
||||||
|
|
||||||
|
//メソッド
|
||||||
|
public void showInfo(String employee[]) {
|
||||||
|
System.out.println(this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
61
Main_20261014_hirayama.java
Normal file
61
Main_20261014_hirayama.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
|
||||||
|
EmployeeData[] employee = new EmployeeData[5];
|
||||||
|
|
||||||
|
//インスタンス生成
|
||||||
|
/*EmployeeData em1 = new EmployeeData();
|
||||||
|
EmployeeData em2 = new EmployeeData();
|
||||||
|
EmployeeData em3 = new EmployeeData();
|
||||||
|
EmployeeData em4 = new EmployeeData();
|
||||||
|
EmployeeData em5 = new EmployeeData();*/
|
||||||
|
|
||||||
|
|
||||||
|
//代入
|
||||||
|
employee[0].idEmployee = "10000";
|
||||||
|
employee[0].nmEmployee = "山田龍也";
|
||||||
|
employee[0].knEmployee = "ヤマダタツヤ";
|
||||||
|
employee[0].mailAddress = "yamada@hoge.jp";
|
||||||
|
employee[0].password = "aaa";
|
||||||
|
employee[0].idDepartment = "10";
|
||||||
|
|
||||||
|
employee[1].idEmployee = "10001";
|
||||||
|
employee[1].nmEmployee = "高橋準";
|
||||||
|
employee[1].knEmployee = "タカハシジュン";
|
||||||
|
employee[1].mailAddress = "jtaka@hoge.jp";
|
||||||
|
employee[1].password = "bbb";
|
||||||
|
employee[1].idDepartment = "10";
|
||||||
|
|
||||||
|
employee[2].idEmployee = "10002";
|
||||||
|
employee[2].nmEmployee = "麻枝史明";
|
||||||
|
employee[2].knEmployee = "マエダフミアキ";
|
||||||
|
employee[2].mailAddress = "fmak@hoge.jp";
|
||||||
|
employee[2].password = "ccc";
|
||||||
|
employee[2].idDepartment = "11";
|
||||||
|
|
||||||
|
employee[3].idEmployee = "10003";
|
||||||
|
employee[3].nmEmployee = "丸戸章介";
|
||||||
|
employee[3].knEmployee = "マルトショウスケ";
|
||||||
|
employee[3].mailAddress = "marusyo@hoge.jp";
|
||||||
|
employee[3].password = "ddd";
|
||||||
|
employee[3].idDepartment = "12";
|
||||||
|
|
||||||
|
employee[4].idEmployee = "10004";
|
||||||
|
employee[4].nmEmployee = "三宅武";
|
||||||
|
employee[4].knEmployee = "ミヤケタケシ";
|
||||||
|
employee[4].mailAddress = "miya@hoge.jp";
|
||||||
|
employee[4].password = "eee";
|
||||||
|
employee[4].idDepartment = "13";
|
||||||
|
|
||||||
|
/*メソッド呼び出し
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
employee[].showInfo();
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
24
ObjectSample_20261014_hirayama.java
Normal file
24
ObjectSample_20261014_hirayama.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
public class ObjectSample {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
//原本のコピー(インスタンス生成)
|
||||||
|
Student student1 = new Student();
|
||||||
|
Student student2 = new Student();
|
||||||
|
|
||||||
|
//name、ageへの代入
|
||||||
|
student1.name = "田中";
|
||||||
|
student1.age = 30;
|
||||||
|
|
||||||
|
student2.name = "山本";
|
||||||
|
student2.age = 25;
|
||||||
|
|
||||||
|
//introduceメソッドの呼び出し
|
||||||
|
student1.intoroduce();
|
||||||
|
|
||||||
|
student2.intoroduce();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
13
Student_20261014_hirayama.java
Normal file
13
Student_20261014_hirayama.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
public class Student {
|
||||||
|
//フィールドの宣言
|
||||||
|
String name;
|
||||||
|
int age;
|
||||||
|
|
||||||
|
//メソッドの定義
|
||||||
|
public void intoroduce() {
|
||||||
|
System.out.println("私の名前は" + this.name);
|
||||||
|
System.out.println("年齢は" + this.age);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>em-oop</name>
|
<name>Mission_em_oop</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
@@ -10,14 +10,8 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=21
|
org.eclipse.jdt.core.compiler.compliance=21
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=21
|
org.eclipse.jdt.core.compiler.source=21
|
||||||
BIN
em-oop_hirayama/bin/BaseData.class
Normal file
BIN
em-oop_hirayama/bin/BaseData.class
Normal file
Binary file not shown.
BIN
em-oop_hirayama/bin/EmployeeData.class
Normal file
BIN
em-oop_hirayama/bin/EmployeeData.class
Normal file
Binary file not shown.
BIN
em-oop_hirayama/bin/Main.class
Normal file
BIN
em-oop_hirayama/bin/Main.class
Normal file
Binary file not shown.
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
public abstract class BaseDate {
|
public abstract class BaseData {
|
||||||
|
//メソッド
|
||||||
public abstract String toString();
|
public abstract String toString();
|
||||||
public abstract String toCSV();
|
public abstract String toCSV();
|
||||||
public abstract String getPrimaryKeyValue();
|
public abstract String getPrimaryKeyValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
101
em-oop_hirayama/src/EmployeeData.java
Normal file
101
em-oop_hirayama/src/EmployeeData.java
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
|
||||||
|
public class EmployeeData extends BaseData {
|
||||||
|
//フィールド
|
||||||
|
private String idEmployee;
|
||||||
|
private String nmEmployee;
|
||||||
|
private String knEmployee;
|
||||||
|
private String mailAddress;
|
||||||
|
private String password;
|
||||||
|
private String idDepartment;
|
||||||
|
|
||||||
|
|
||||||
|
//コンストラクタ
|
||||||
|
public EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password, String idDepartment) {
|
||||||
|
this.setIdEmployee(idEmployee);
|
||||||
|
this.setNmEmployee(nmEmployee);
|
||||||
|
this.setKnEmployee(knEmployee);
|
||||||
|
this.setMailAddress(mailAddress);
|
||||||
|
this.setPassword(password);
|
||||||
|
this.setIdDepartment(idDepartment);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmployeeData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//idEmployeeゲッター
|
||||||
|
public String getIdEmployee() {
|
||||||
|
return idEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
//セッター
|
||||||
|
public void setIdEmployee(String idEmployee) {
|
||||||
|
this.idEmployee =idEmployee;
|
||||||
|
}
|
||||||
|
//nmEmployeeゲッター
|
||||||
|
public String getNmEmployee() {
|
||||||
|
return nmEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
//nmEmployeeセッター
|
||||||
|
public void setNmEmployee(String nmEmployee) {
|
||||||
|
this.nmEmployee = nmEmployee;
|
||||||
|
}
|
||||||
|
//knEmployeeゲッター
|
||||||
|
public String getKnEmployee() {
|
||||||
|
return knEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
//knEmployeeセッター
|
||||||
|
public void setKnEmployee(String knEmployee) {
|
||||||
|
this.knEmployee = knEmployee;
|
||||||
|
}
|
||||||
|
//mailAddressゲッター
|
||||||
|
public String getMailAddress() {
|
||||||
|
return mailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mailAddressセッター
|
||||||
|
public void setMailAddress(String mailAddress) {
|
||||||
|
this.mailAddress = mailAddress;
|
||||||
|
}
|
||||||
|
//passwordゲッター
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
//passwordセッター
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
//nmEmployeeゲッター
|
||||||
|
public String getIdDepartment() {
|
||||||
|
return idDepartment;
|
||||||
|
}
|
||||||
|
|
||||||
|
//nmEmployeeセッター
|
||||||
|
public void setIdDepartment(String idDepartment) {
|
||||||
|
this.idDepartment = idDepartment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//メソッド
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return (this.idEmployee + "\t" + this.nmEmployee + "\t" + this.knEmployee + "\t" + this.mailAddress + "\t" + this.password + "\t" + this.idDepartment);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toCSV() {
|
||||||
|
return getIdEmployee() + "," + getNmEmployee() + "," + getKnEmployee() + "," + getMailAddress() + "," + getPassword() + "," + getIdDepartment();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrimaryKeyValue() {
|
||||||
|
return idEmployee;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
74
em-oop_hirayama/src/Main.java
Normal file
74
em-oop_hirayama/src/Main.java
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
|
||||||
|
EmployeeData[] employee = new EmployeeData[5];
|
||||||
|
|
||||||
|
|
||||||
|
//インスタンス生成,代入
|
||||||
|
EmployeeData em1 = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
|
||||||
|
employee[0] = em1;
|
||||||
|
EmployeeData em2 = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "10");
|
||||||
|
employee[1] = em2;
|
||||||
|
EmployeeData em3 = new EmployeeData("10002", "麻枝史明", "マエダフミアキ", "fmak@hoge.jp", "ccc", "11");
|
||||||
|
employee[2] = em3;
|
||||||
|
EmployeeData em4 = new EmployeeData("10003", "丸戸章介", "マルトショウスケ", "marusyo@hoge.jp", "ddd", "12");
|
||||||
|
employee[3] = em4;
|
||||||
|
EmployeeData em5 = new EmployeeData("10004", "三宅武", "ミヤケタケシ", "miya@hoge.jp", "eee", "13");
|
||||||
|
employee[4] = em5;
|
||||||
|
|
||||||
|
//代入
|
||||||
|
employee[0].setIdEmployee("10000");
|
||||||
|
employee[0].setNmEmployee("山田龍也");
|
||||||
|
employee[0].setKnEmployee("ヤマダタツヤ");
|
||||||
|
employee[0].setMailAddress("yamada@hoge.jp");
|
||||||
|
employee[0].setPassword("aaa");
|
||||||
|
employee[0].setIdDepartment("10");
|
||||||
|
|
||||||
|
employee[1].setIdEmployee("10001");
|
||||||
|
employee[1].setNmEmployee("高橋準");
|
||||||
|
employee[1].setKnEmployee("タカハシジュン");
|
||||||
|
employee[1].setMailAddress("jtaka@hoge.jp");
|
||||||
|
employee[1].setPassword("bbb");
|
||||||
|
employee[1].setIdDepartment("10");
|
||||||
|
|
||||||
|
employee[2].setIdEmployee("10002");
|
||||||
|
employee[2].setNmEmployee("麻枝史明");
|
||||||
|
employee[2].setKnEmployee("マエダフミアキ");
|
||||||
|
employee[2].setMailAddress("fmak@hoge.jp");
|
||||||
|
employee[2].setPassword("ccc");
|
||||||
|
employee[2].setIdDepartment("11");
|
||||||
|
|
||||||
|
employee[3].setIdEmployee("10003");
|
||||||
|
employee[3].setNmEmployee("丸戸章介");
|
||||||
|
employee[3].setKnEmployee("マルトショウスケ");
|
||||||
|
employee[3].setMailAddress("marusyo@hoge.jp");
|
||||||
|
employee[3].setPassword("ddd");
|
||||||
|
employee[3].setIdDepartment("12");
|
||||||
|
|
||||||
|
employee[4].setIdEmployee("10004");
|
||||||
|
employee[4].setNmEmployee("三宅武");
|
||||||
|
employee[4].setKnEmployee("ミヤケタケシ");
|
||||||
|
employee[4].setMailAddress("miya@hoge.jp");
|
||||||
|
employee[4].setPassword("eee");
|
||||||
|
employee[4].setIdDepartment("13");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//メソッド呼び出し
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
System.out.println(employee[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(employee[0].toCSV());
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println(employee[0].getPrimaryKeyValue());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
public class EmployeeData extends BaseDate {
|
|
||||||
|
|
||||||
//フィールドの宣言
|
|
||||||
//社員ID
|
|
||||||
private String idEmployee;
|
|
||||||
//社員名
|
|
||||||
private String nmEmployee;
|
|
||||||
//社員名カナ
|
|
||||||
private String knEmployee;
|
|
||||||
//メールアドレス
|
|
||||||
private String mailAddress;
|
|
||||||
//パスワード
|
|
||||||
private String password;
|
|
||||||
//部署ID
|
|
||||||
private String idDepartment;
|
|
||||||
|
|
||||||
public static int empCount;
|
|
||||||
|
|
||||||
|
|
||||||
//ゲッターとセッター
|
|
||||||
public String getIdEmployee() {
|
|
||||||
return idEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIdEmployee(String idEmployee) {
|
|
||||||
this.idEmployee = idEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getNmEmployee() {
|
|
||||||
return nmEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setNmEmployee(String nmEmployee) {
|
|
||||||
|
|
||||||
if(nmEmployee == null) {
|
|
||||||
System.out.println("社員名が空のため設定できませんでした");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.nmEmployee = nmEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
//文字列前後の空白を取り除く
|
|
||||||
String trimmednmEmployee = nmEmployee.trim();
|
|
||||||
//文字列の長さを調べる
|
|
||||||
int count = trimmednmEmployee.length();
|
|
||||||
|
|
||||||
if(count == 0) {
|
|
||||||
System.out.println("社員名が空のため設定できませんでした");
|
|
||||||
}else {
|
|
||||||
this.nmEmployee = nmEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getKnEmployee() {
|
|
||||||
return knEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setKnEmployee(String knEmployee) {
|
|
||||||
this.knEmployee = knEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getMailAddress() {
|
|
||||||
return mailAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setMailAddress(String mailAddress) {
|
|
||||||
this.mailAddress = mailAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getIdDepartment() {
|
|
||||||
return idDepartment;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setIdDepartment(String idDepartment) {
|
|
||||||
if(idDepartment == null) {
|
|
||||||
System.out.println("社員IDが空のため設定できませんでした");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.idDepartment = idDepartment;
|
|
||||||
}
|
|
||||||
|
|
||||||
//文字列前後の空白を取り除く
|
|
||||||
String trimmednmEmployee = nmEmployee.trim();
|
|
||||||
//文字列の長さを調べる
|
|
||||||
int count = trimmednmEmployee.length();
|
|
||||||
|
|
||||||
if(count == 0) {
|
|
||||||
System.out.println("社員IDがのため設定できませんでした");
|
|
||||||
}else {
|
|
||||||
this.idDepartment = idDepartment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static int getEmpCount() {
|
|
||||||
return empCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setEmpCount(int empCount) {
|
|
||||||
EmployeeData.empCount = empCount ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//コンストラクタの作成
|
|
||||||
public EmployeeData() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public EmployeeData(String idEmployee, String nmEmployee, String knEmployee, String mailAddress, String password, String idDepartment, int empCount) {
|
|
||||||
this.setIdEmployee(idEmployee);
|
|
||||||
this.setNmEmployee(nmEmployee);
|
|
||||||
this.setKnEmployee(knEmployee);
|
|
||||||
this.setMailAddress(mailAddress);
|
|
||||||
this.setPassword(password);
|
|
||||||
this.setIdDepartment(idDepartment);
|
|
||||||
this.setEmpCount(empCount);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//メソッドの作成
|
|
||||||
|
|
||||||
@Override public String toString() {
|
|
||||||
|
|
||||||
return (getIdEmployee() +"\t"+ getNmEmployee() +"\t"+ getKnEmployee() +"\t"+ getMailAddress() +"\t"+ getPassword() +"\t"+ getIdDepartment());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static int EmpCount() {
|
|
||||||
return getEmpCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public String toCSV(){
|
|
||||||
return (getIdEmployee() +","+ getNmEmployee() +","+ getKnEmployee() +","+ getMailAddress() +","+ getPassword() +","+ getIdDepartment());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public String getPrimaryKeyValue() {
|
|
||||||
return idEmployee;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
public class em_oop_20261014 {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// TODO 自動生成されたメソッド・スタブ
|
|
||||||
|
|
||||||
|
|
||||||
//インスタンスの生成
|
|
||||||
EmployeeData[] employees = new EmployeeData[5];
|
|
||||||
|
|
||||||
employees[0] = new EmployeeData("10000", "山田達也", "ヤマダタツヤ","yamada@hoge.jp" ,"aaa", "10",0);
|
|
||||||
employees[1] = new EmployeeData("10001","高橋準","タカハシジュン","jtaka@hoge.jp","bbb","10",1);
|
|
||||||
employees[2] = new EmployeeData("10002","麻枝史明","マエダフミアキ","fmak@hoge.jp","ccc","11",2);
|
|
||||||
employees[3] = new EmployeeData("10003","丸戸章介","マルトショウスケ","marusyo@hoge.jp","ddd","12",3);
|
|
||||||
employees[4] = new EmployeeData("10004","三宅武","ミヤケタケシ","miya@hoge.jp","eee","13",4);
|
|
||||||
|
|
||||||
|
|
||||||
//呼び出し
|
|
||||||
System.out.println(employees[0]);
|
|
||||||
System.out.println(employees[1]);
|
|
||||||
System.out.println(employees[2]);
|
|
||||||
System.out.println(employees[3]);
|
|
||||||
System.out.println(employees[4]);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("現在の社員データ件数:" + employees.length);
|
|
||||||
|
|
||||||
//employees.toCSV();
|
|
||||||
//employees.getPrimaryKeyValue();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user