Added classes according to class diagram

generic-observer
SirTeruki 7 years ago
parent 80b9703b0c
commit 7f6a73be00

@ -14,17 +14,13 @@ public class Out {
System.out.println(d);
}
public static void out(char c) {
System.out.println(c);
}
public static void out(char c) { System.out.println(c); }
public static void out(String s) {
System.out.println(s);
}
public static void out(Object o) {
System.out.println(o);
}
public static void out(Object o) { System.out.println(o); }
}

@ -6,16 +6,28 @@ public class Account {
private long balance;
private String iban;
public Account(String iban) { this.iban = iban; }
public Account(String iban) {
this.iban = iban;
}
public Customer[] getHolders() { return holders; }
public Customer[] getHolders() {
return holders;
}
public void setHolders(Customer[] holders) { this.holders = holders; }
public void setHolders(Customer[] holders) {
this.holders = holders;
}
public long getBalance() { return balance; }
public long getBalance() {
return balance;
}
public void setBalance(long balance) { this.balance = balance; }
public void setBalance(long balance) {
this.balance = balance;
}
public String getIban() { return iban; }
public String getIban() {
return iban;
}
}

@ -6,16 +6,28 @@ public class Address {
private String postCode;
private String city;
public String getStreet() { return street; }
public String getStreet() {
return street;
}
public void setStreet(String street) { this.street = street; }
public void setStreet(String street) {
this.street = street;
}
public String getPostCode() { return postCode; }
public String getPostCode() {
return postCode;
}
public void setPostCode(String postCode) { this.postCode = postCode; }
public void setPostCode(String postCode) {
this.postCode = postCode;
}
public String getCity() { return city; }
public String getCity() {
return city;
}
public void setCity(String city) { this.city = city; }
public void setCity(String city) {
this.city = city;
}
}

@ -5,14 +5,24 @@ public class Bank {
private String name;
private Account[] accounts;
public Bank(String name) { this.name = name; }
public Bank(String name) {
this.name = name;
}
public String getName() { return name; }
public String getName() {
return name;
}
public void setName(String name) { this.name = name; }
public void setName(String name) {
this.name = name;
}
public Account[] getAccounts() { return accounts; }
public Account[] getAccounts() {
return accounts;
}
public void setAccounts(Account[] accounts) { this.accounts = accounts; }
public void setAccounts(Account[] accounts) {
this.accounts = accounts;
}
}

@ -21,7 +21,7 @@ public class Banking {
work.setPostCode("54321");
work.setCity("Erebor");
thorin.setWorkAddress(work);
sbt.getAccounts()[0].setHolders(new Customer[] { thorin });
sbt.getAccounts()[0].setHolders(new Customer[]{thorin});
}
}

@ -1,26 +1,42 @@
package _3._1;
public class Customer {
public class Customer extends BankUser{
private String name;
private Account[] accounts;
private Address homeAddress;
private Address workAddress;
public String getName() { return name; }
public String getName() {
return name;
}
public void setName(String name) { this.name = name; }
public void setName(String name) {
this.name = name;
}
public Account[] getAccounts() { return accounts; }
public Account[] getAccounts() {
return accounts;
}
public void setAccounts(Account[] accounts) { this.accounts = accounts; }
public void setAccounts(Account[] accounts) {
this.accounts = accounts;
}
public Address getHomeAddress() { return homeAddress; }
public Address getHomeAddress() {
return homeAddress;
}
public void setHomeAddress(Address homeAddress) { this.homeAddress = homeAddress; }
public void setHomeAddress(Address homeAddress) {
this.homeAddress = homeAddress;
}
public Address getWorkAddress() { return workAddress; }
public Address getWorkAddress() {
return workAddress;
}
public void setWorkAddress(Address workAddress) { this.workAddress = workAddress; }
public void setWorkAddress(Address workAddress) {
this.workAddress = workAddress;
}
}

@ -0,0 +1,22 @@
package _3._1;
public class PostOfficeBox {
private String poBoxCode;
private String poBoxCity;
public String getPoBoxCode() {
return poBoxCode;
}
public void setPoBoxCode(String poBoxCode) {
this.poBoxCode = poBoxCode;
}
public String getPoBoxCity() {
return poBoxCity;
}
public void setPoBoxCity(String poBoxCity) {
this.poBoxCity = poBoxCity;
}
}

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.3.0">
<?xml version="1.0" encoding="UTF-8"?><diagram program="umlet" version="13.3">
<zoom_level>10</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>460</x>
<y>260</y>
<y>250</y>
<w>210</w>
<h>200</h>
</coordinates>
@ -20,7 +19,7 @@
<id>UMLClass</id>
<coordinates>
<x>460</x>
<y>10</y>
<y>0</y>
<w>210</w>
<h>90</h>
</coordinates>
@ -36,7 +35,7 @@ Account(iban: String)</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>0</x>
<y>260</y>
<y>250</y>
<w>210</w>
<h>180</h>
</coordinates>
@ -51,7 +50,7 @@ Account(iban: String)</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>10</x>
<y>10</y>
<y>0</y>
<w>210</w>
<h>70</h>
</coordinates>
@ -66,8 +65,8 @@ Account(iban: String)</panel_attributes>
<id>Relation</id>
<coordinates>
<x>560</x>
<y>90</y>
<w>90</w>
<y>80</y>
<w>100</w>
<h>190</h>
</coordinates>
<panel_attributes>lt=&lt;-&gt;
@ -81,7 +80,7 @@ m1=0..*</panel_attributes>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>260</y>
<y>250</y>
<w>280</w>
<h>50</h>
</coordinates>
@ -94,7 +93,7 @@ m1=1</panel_attributes>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>360</y>
<y>350</y>
<w>280</w>
<h>50</h>
</coordinates>
@ -107,7 +106,7 @@ r1=1</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>0</x>
<y>540</y>
<y>530</y>
<w>210</w>
<h>70</h>
</coordinates>
@ -120,7 +119,7 @@ r1=1</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>270</x>
<y>490</y>
<y>480</y>
<w>210</w>
<h>70</h>
</coordinates>
@ -133,7 +132,7 @@ r1=1</panel_attributes>
<id>Relation</id>
<coordinates>
<x>40</x>
<y>430</y>
<y>420</y>
<w>30</w>
<h>130</h>
</coordinates>
@ -144,7 +143,7 @@ r1=1</panel_attributes>
<id>Relation</id>
<coordinates>
<x>160</x>
<y>430</y>
<y>420</y>
<w>170</w>
<h>80</h>
</coordinates>
@ -155,7 +154,7 @@ r1=1</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>270</x>
<y>660</y>
<y>650</y>
<w>210</w>
<h>70</h>
</coordinates>
@ -169,8 +168,8 @@ r1=1</panel_attributes>
<id>Relation</id>
<coordinates>
<x>310</x>
<y>550</y>
<w>120</w>
<y>540</y>
<w>130</w>
<h>130</h>
</coordinates>
<panel_attributes>lt=&lt;-
@ -182,21 +181,21 @@ m1=0..1</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>520</x>
<y>580</y>
<y>570</y>
<w>210</w>
<h>70</h>
</coordinates>
<panel_attributes>*FinancialAdvisor*
--
</panel_attributes>
- customer: Customer[]</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>560</x>
<y>450</y>
<w>100</w>
<y>440</y>
<w>110</w>
<h>150</h>
</coordinates>
<panel_attributes>lt=&lt;-
@ -208,7 +207,7 @@ m1=0..*</panel_attributes>
<id>UMLClass</id>
<coordinates>
<x>800</x>
<y>280</y>
<y>270</y>
<w>210</w>
<h>70</h>
</coordinates>
@ -221,7 +220,7 @@ m1=0..*</panel_attributes>
<id>Relation</id>
<coordinates>
<x>660</x>
<y>300</y>
<y>290</y>
<w>160</w>
<h>30</h>
</coordinates>
@ -232,7 +231,7 @@ m1=0..*</panel_attributes>
<id>Relation</id>
<coordinates>
<x>720</x>
<y>340</y>
<y>330</y>
<w>130</w>
<h>300</h>
</coordinates>
@ -243,7 +242,7 @@ m1=0..*</panel_attributes>
<id>Relation</id>
<coordinates>
<x>210</x>
<y>30</y>
<y>20</y>
<w>270</w>
<h>50</h>
</coordinates>

Loading…
Cancel
Save