changes
This commit is contained in:
@@ -42,7 +42,7 @@ jar {
|
||||
|
||||
tasks.named('jar') {
|
||||
manifest {
|
||||
attributes('Implementation-Title': 'reservationsystem',
|
||||
attributes('Implementation-Title': 'lodge.reservationsystem',
|
||||
'Implementation-Version': 1.0,
|
||||
'Main-Class': 'lodge.TestReservations',
|
||||
'Class-Path': 'lodge.reservationsystem com.google.gson .' )
|
||||
|
||||
BIN
reservationsystem_0915.png
Normal file
BIN
reservationsystem_0915.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
@@ -8,16 +8,17 @@ package lodge;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import lodge.data.Account;
|
||||
import lodge.data.Address;
|
||||
import lodge.data.DuplicateObjectException;
|
||||
import lodge.data.EmailAddress;
|
||||
import lodge.data.Reservation;
|
||||
import lodge.data.ReservationStatusEnum;
|
||||
import lodge.reservationsystem.AccomodationManager;
|
||||
import lodge.reservationsystem.Account;
|
||||
import lodge.reservationsystem.Address;
|
||||
import lodge.reservationsystem.CabinReservation;
|
||||
import lodge.reservationsystem.DuplicateObjectException;
|
||||
import lodge.reservationsystem.EmailAddress;
|
||||
import lodge.reservationsystem.HotelReservation;
|
||||
import lodge.reservationsystem.HouseReservation;
|
||||
import lodge.reservationsystem.Reservation;
|
||||
import lodge.reservationsystem.ReservationStatusEnum;
|
||||
import lodge.reservationsystem.IReservation;
|
||||
|
||||
public final class TestReservations {
|
||||
public static void main(String[] args) throws Exception {
|
||||
@@ -101,27 +102,30 @@ public final class TestReservations {
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
try {
|
||||
mgr.addReservation(acct, cabin);
|
||||
mgr.UpdateAccount(mgr.retrieveAccount(acct.getAccount_number()));
|
||||
if( mgr.addReservation(acct, cabin) ){
|
||||
mgr.UpdateAccount(mgr.retrieveAccount(acct.getAccount_number()));
|
||||
}
|
||||
} catch (DuplicateObjectException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
Account account = mgr.retrieveLoadedAccounts().getFirst();
|
||||
Account account = mgr.retrieveLoadedAccounts().get(0);
|
||||
|
||||
Reservation rsrv = account.findReservation(house.getReservation_number());
|
||||
// 6. Complete reservation that is associated with an account
|
||||
mgr.retreiveReservation(house.getReservation_number());
|
||||
house.Change(house, ReservationStatusEnum.Completed);
|
||||
Reservation rsrv = account.findReservation(house.getReservation_number());
|
||||
house.Change(rsrv, ReservationStatusEnum.Completed);
|
||||
mgr.UpdateAccount(mgr.retrieveAccount(acct.getAccount_number()));
|
||||
|
||||
// 7. Cancel reservation that is associated with an account
|
||||
mgr.retreiveReservation(house.getReservation_number());
|
||||
house.Change(house, ReservationStatusEnum.Canceled);
|
||||
mgr.UpdateAccount(mgr.retrieveAccount(acct.getAccount_number()));
|
||||
account = mgr.retrieveLoadedAccounts().getLast();
|
||||
IReservation ir = account.getAllReservations().next();
|
||||
rsrv = (Reservation)ir;
|
||||
rsrv.Change(rsrv, ReservationStatusEnum.Canceled);
|
||||
mgr.UpdateAccount(mgr.retrieveAccount(rsrv.getAccountNumber()));
|
||||
|
||||
// 8. Change reservation values that can be changed (if reservation is
|
||||
// cancelled, completed, or for past date, it is considered an error)
|
||||
rsrv.Change(rsrv, ReservationStatusEnum.Completed);
|
||||
house.update(house);
|
||||
|
||||
// 9. Request for price per night to be calculated and returned for a
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
@@ -12,11 +12,14 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import lodge.reservationsystem.IReservation;
|
||||
|
||||
public class Account {
|
||||
private String account_number = "-99";
|
||||
private String phone_number;
|
||||
private Address mailing_address;
|
||||
private EmailAddress email_address;
|
||||
private final AccountReservationList reservations = new AccountReservationList();
|
||||
|
||||
protected Account() {
|
||||
|
||||
@@ -40,8 +43,6 @@ public class Account {
|
||||
email_address);
|
||||
}
|
||||
|
||||
private final AccountReservationList reservation_list = new AccountReservationList();;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -51,7 +52,7 @@ public class Account {
|
||||
sb.append("\"phone_number\": \"").append(phone_number).append("\",");
|
||||
sb.append("\"mailing_address\": ").append(mailing_address).append(",");
|
||||
sb.append("\"email_address\": ").append(email_address).append(",");
|
||||
sb.append(this.reservation_list.toString());
|
||||
sb.append(this.reservations.toString());
|
||||
sb.append("}}");
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -62,7 +63,7 @@ public class Account {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
result = reservation_list.add(rsrv);
|
||||
result = reservations.add((IReservation) rsrv);
|
||||
} catch (DuplicateObjectException e) {
|
||||
System.out.println(String.format("%s", e.getMessage()));
|
||||
} finally {
|
||||
@@ -84,7 +85,8 @@ public class Account {
|
||||
writer.flush();
|
||||
}
|
||||
|
||||
for (Reservation r : acct.reservation_list) {
|
||||
for (IReservation i : acct.reservations) {
|
||||
Reservation r = (Reservation) i;
|
||||
r.Write(r);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +132,7 @@ public class Account {
|
||||
}
|
||||
|
||||
public Reservation findReservation(String reservation_number) {
|
||||
return this.reservation_list.find(reservation_number);
|
||||
return this.reservations.find(reservation_number);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -156,8 +158,8 @@ public class Account {
|
||||
this.setMailing_address(acct.mailing_address);
|
||||
}
|
||||
|
||||
public ListIterator<Reservation> getAllReservations() {
|
||||
return this.reservation_list.listIterator();
|
||||
public ListIterator<IReservation> getAllReservations() {
|
||||
return this.reservations.listIterator();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -10,7 +10,9 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
class AccountList extends ArrayList<Account> {
|
||||
import lodge.reservationsystem.IReservation;
|
||||
|
||||
public class AccountList extends ArrayList<Account> {
|
||||
|
||||
public static String accountSerial(String phone_number, Address mailing_address, EmailAddress email_address) {
|
||||
return String.format("A%09d", Math.abs(java.util.Objects.hash(phone_number, mailing_address, email_address)));
|
||||
@@ -51,10 +53,10 @@ class AccountList extends ArrayList<Account> {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<? extends Reservation> getListOfReservations() {
|
||||
ArrayList<Reservation> readList = new ArrayList<>();
|
||||
public List<? extends IReservation> getListOfReservations() {
|
||||
ArrayList<IReservation> readList = new ArrayList<>();
|
||||
for (Account acct: this){
|
||||
ListIterator<Reservation> itr = acct.getAllReservations();
|
||||
ListIterator<IReservation> itr = acct.getAllReservations();
|
||||
while( itr.hasNext() ){
|
||||
readList.add(itr.next());
|
||||
}
|
||||
@@ -2,32 +2,34 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
class AccountReservationList extends ArrayList<Reservation> {
|
||||
import lodge.reservationsystem.IReservation;
|
||||
|
||||
class AccountReservationList extends ArrayList<IReservation> {
|
||||
|
||||
private static String reservationSerial(Reservation reservation) {
|
||||
return String.format("R%010d", Math.abs(java.util.Objects.hash(reservation.getPhysical_address())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean add(final Reservation reservation) throws RuntimeException{
|
||||
public synchronized boolean add(final IReservation reservation) throws RuntimeException{
|
||||
boolean result = true;
|
||||
Reservation rsrv = this.find(reservation.getReservation_number());
|
||||
result = rsrv == null;
|
||||
if( !result ){
|
||||
throw new DuplicateObjectException(String.format("Error No Dups, Reservation exists: %s.", rsrv.getReservation_number()));
|
||||
}
|
||||
result = reservation.checkValid();
|
||||
result = ((IReservation)reservation).checkValid();
|
||||
|
||||
if(result){
|
||||
reservation.setReservation_number(AccountReservationList.reservationSerial(reservation));
|
||||
reservation.setPrice(reservation.calculatePrice());
|
||||
((Reservation)reservation).setReservation_number(AccountReservationList.reservationSerial((Reservation)reservation));
|
||||
((Reservation)reservation).setPrice(reservation.calculatePrice());
|
||||
result = super.add(reservation);
|
||||
}else{
|
||||
throw new IllegalArgumentException(String.format("error reservation invalid: %s", reservation.getReservation_number()));
|
||||
throw new IllegalArgumentException(String.format("error reservation invalid: %s", ((Reservation)reservation).getReservation_number()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -35,7 +37,7 @@ class AccountReservationList extends ArrayList<Reservation> {
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("\"reservation_list\":[");
|
||||
sb.append("\"reservations\":[");
|
||||
|
||||
for (int ix = 0; ix < this.size(); ix++) {
|
||||
String name = this.get(ix).ReservationType() + "";
|
||||
@@ -53,19 +55,19 @@ class AccountReservationList extends ArrayList<Reservation> {
|
||||
}
|
||||
|
||||
public Reservation find(String reservation_number) {
|
||||
for(Reservation rsrv: this){
|
||||
for(IReservation rsrv: this){
|
||||
if( rsrv.getReservation_number().compareTo(reservation_number) == 0 ){
|
||||
return rsrv;
|
||||
return (Reservation)rsrv;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void update(AccountReservationList incoming_reservation_list) {
|
||||
for (Reservation rsrv : incoming_reservation_list) {
|
||||
for (IReservation rsrv : incoming_reservation_list) {
|
||||
Reservation onListRsrv = find(rsrv.getReservation_number());
|
||||
if( onListRsrv != null ){
|
||||
onListRsrv.update(rsrv);
|
||||
onListRsrv.update((Reservation)rsrv);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
public final class Address{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
@@ -18,7 +18,12 @@ import java.time.ZonedDateTime;
|
||||
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
final class DataRepository {
|
||||
import lodge.reservationsystem.AccomodationManager;
|
||||
import lodge.reservationsystem.CabinReservation;
|
||||
import lodge.reservationsystem.HotelReservation;
|
||||
import lodge.reservationsystem.HouseReservation;
|
||||
|
||||
public final class DataRepository {
|
||||
// SINGLETON CLASS
|
||||
// hard code data store location for storage of
|
||||
// account data files on filesystem
|
||||
@@ -37,6 +42,18 @@ final class DataRepository {
|
||||
return getInstance().directoryPath;
|
||||
}
|
||||
|
||||
public final static Reservation Reservation(String type) {
|
||||
switch (type) {
|
||||
case "HotelReservation":
|
||||
return HotelReservation.copy(type);
|
||||
case "HouseReservation":
|
||||
return HouseReservation.copy(type);
|
||||
case "CabinReservation":
|
||||
return CabinReservation.copy(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void WalkFileSystemTree(final AccomodationManager manager, final Path rootDir) throws IOException {
|
||||
Files.walkFileTree(rootDir, new SimpleFileVisitor<Path>() {
|
||||
@Override
|
||||
@@ -116,7 +133,7 @@ final class DataRepository {
|
||||
jsonReader.endObject();
|
||||
jsonReader.endObject();
|
||||
break;
|
||||
case "reservation_list":
|
||||
case "reservations":
|
||||
loadReservationRefList(jsonReader, ac);
|
||||
break;
|
||||
default:
|
||||
@@ -159,15 +176,15 @@ final class DataRepository {
|
||||
switch (name) {
|
||||
case "HotelReservation":
|
||||
jsonReader.beginObject();
|
||||
rsrv = new HotelReservation();
|
||||
rsrv = Reservation("HotelReservation");
|
||||
break;
|
||||
case "HouseReservation":
|
||||
jsonReader.beginObject();
|
||||
rsrv = new HouseReservation();
|
||||
rsrv = Reservation("HouseReservation");
|
||||
break;
|
||||
case "CabinReservation":
|
||||
jsonReader.beginObject();
|
||||
rsrv = new CabinReservation();
|
||||
rsrv = Reservation("CabinReservation");
|
||||
break;
|
||||
case "physical_address":
|
||||
jsonReader.beginObject();
|
||||
@@ -180,7 +197,7 @@ final class DataRepository {
|
||||
jsonReader.nextName();
|
||||
String state = jsonReader.nextString();
|
||||
jsonReader.nextName();
|
||||
String zip =jsonReader.nextString();
|
||||
String zip = jsonReader.nextString();
|
||||
jsonReader.endObject();
|
||||
jsonReader.endObject();
|
||||
rsrv.setPhysical_address(new Address(street, city, state, zip));
|
||||
@@ -196,7 +213,7 @@ final class DataRepository {
|
||||
jsonReader.nextName();
|
||||
String mstate = jsonReader.nextString();
|
||||
jsonReader.nextName();
|
||||
String mzip =jsonReader.nextString();
|
||||
String mzip = jsonReader.nextString();
|
||||
jsonReader.endObject();
|
||||
jsonReader.endObject();
|
||||
rsrv.setMailing_address(new Address(mstreet, mcity, mstate, mzip));
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
public class DuplicateObjectException extends RuntimeException {
|
||||
public DuplicateObjectException() {
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
public class EmailAddress{
|
||||
String email_address;
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
public enum KitchenTypeEnum {
|
||||
None, Kitchenette, FullKitchen;
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
@@ -12,7 +12,10 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
public abstract class Reservation{
|
||||
import lodge.reservationsystem.IReservation;
|
||||
import lodge.reservationsystem.IllegalOperationException;
|
||||
|
||||
public abstract class Reservation {
|
||||
private char type;
|
||||
private String reservation_number = "-99";
|
||||
private Address physical_address;
|
||||
@@ -58,7 +61,7 @@ public abstract class Reservation{
|
||||
return this.accountNumber;
|
||||
}
|
||||
|
||||
protected void setAccountNumber(String account_number) {
|
||||
public void setAccountNumber(String account_number) {
|
||||
this.accountNumber = account_number;
|
||||
}
|
||||
|
||||
@@ -126,7 +129,7 @@ public abstract class Reservation{
|
||||
return type;
|
||||
}
|
||||
|
||||
protected void setType(char type) {
|
||||
public void setType(char type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@@ -202,8 +205,7 @@ public abstract class Reservation{
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(String.format("{ \"%s\":{", ReservationType()));
|
||||
sb.append(String.format("{ \"%s\":{", this.ReservationType()));
|
||||
sb.append("\"reservation_type\": \"").append(ReservationType()).append("\",");
|
||||
sb.append("\"reservation_number\": \"").append(reservation_number).append("\",");
|
||||
sb.append("\"reservation_status\": \"").append(reservation_status).append("\",");
|
||||
@@ -237,17 +239,20 @@ public abstract class Reservation{
|
||||
|
||||
public void Change(Reservation reservation, ReservationStatusEnum newStatus) throws IllegalOperationException {
|
||||
try {
|
||||
if (reservation.reservation_status == ReservationStatusEnum.Completed) {
|
||||
if (reservation.reservation_status == ReservationStatusEnum.Completed ||
|
||||
reservation.reservation_status == ReservationStatusEnum.Canceled) {
|
||||
if (newStatus == ReservationStatusEnum.Canceled) {
|
||||
throw new IllegalOperationException("Invalid Change, reservation has completed.");
|
||||
throw new IllegalOperationException(
|
||||
String.format("Invalid Change, reservation has %s.", reservation.getReservation_status()));
|
||||
}
|
||||
if (ZonedDateTime.now().compareTo(this.reservation_start_date) > -1) {
|
||||
throw new IllegalOperationException("Invalid Change, reservation time started.");
|
||||
throw new IllegalOperationException("Invalid Change, reservation has begun.");
|
||||
}
|
||||
}
|
||||
|
||||
if (newStatus == ReservationStatusEnum.Completed) {
|
||||
this.setPrice(this.calculatePrice());
|
||||
IReservation irsrv = (IReservation) this;
|
||||
this.setPrice(irsrv.calculatePrice());
|
||||
}
|
||||
reservation.setReservation_status(newStatus);
|
||||
} catch (IllegalOperationException e) {
|
||||
@@ -260,7 +265,4 @@ public abstract class Reservation{
|
||||
}
|
||||
|
||||
public abstract String ReservationType();
|
||||
public abstract float getPricePerNight();
|
||||
public abstract float calculatePrice();
|
||||
public abstract boolean checkValid();
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* license: GPLv3
|
||||
* lodge.reservationsystem
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
package lodge.data;
|
||||
|
||||
public enum ReservationStatusEnum {
|
||||
Draft,
|
||||
@@ -6,12 +6,20 @@ package lodge.reservationsystem;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lodge.data.Account;
|
||||
import lodge.data.AccountList;
|
||||
import lodge.data.Address;
|
||||
import lodge.data.DataRepository;
|
||||
import lodge.data.EmailAddress;
|
||||
import lodge.data.Reservation;
|
||||
|
||||
public final class AccomodationManager {
|
||||
|
||||
private final AccountList account_list = new AccountList();
|
||||
private final AccountList accounts = new AccountList();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private AccomodationManager() {
|
||||
@@ -27,39 +35,39 @@ public final class AccomodationManager {
|
||||
}
|
||||
|
||||
public final void loadAll() throws Exception {
|
||||
account_list.clear();
|
||||
accounts.clear();
|
||||
// walk directories
|
||||
Path rootDir = Paths.get(DataRepository.getPath());
|
||||
DataRepository.WalkFileSystemTree(this, rootDir);
|
||||
System.out.println(String.format("%s LoadAll Accounts %d", "Deserializing", account_list.size()));
|
||||
System.out.println(String.format("%s LoadAll Accounts %d", "Deserializing", accounts.size()));
|
||||
}
|
||||
|
||||
// Load / Deserialize Account
|
||||
void load(Path file) throws Exception {
|
||||
public void load(Path file) throws Exception {
|
||||
|
||||
Account account = DataRepository.LoadAccount(file);
|
||||
if (account == null) {
|
||||
System.out.println(String.format("%s", file.toString()));
|
||||
} else {
|
||||
account_list.add(account);
|
||||
accounts.add(account);
|
||||
}
|
||||
}
|
||||
|
||||
public final List<Account> retrieveLoadedAccounts() {
|
||||
return Collections.unmodifiableList(account_list);
|
||||
return Collections.unmodifiableList(accounts);
|
||||
}
|
||||
|
||||
public Account retrieveAccount(String acct_id) {
|
||||
return account_list.find(acct_id);
|
||||
return accounts.find(acct_id);
|
||||
}
|
||||
|
||||
public synchronized void AddAccount(final Account acct) throws Exception {
|
||||
account_list.add(acct);
|
||||
accounts.add(acct);
|
||||
}
|
||||
|
||||
public synchronized void UpdateAccount(final Account acct) throws Exception {
|
||||
if( acct != null ){
|
||||
account_list.save(acct);
|
||||
accounts.save(acct);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +79,7 @@ public final class AccomodationManager {
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.toString());
|
||||
}
|
||||
account_list.save(acct);
|
||||
accounts.save(acct);
|
||||
return acct;
|
||||
}
|
||||
|
||||
@@ -80,22 +88,22 @@ public final class AccomodationManager {
|
||||
return result;
|
||||
}
|
||||
|
||||
public final Reservation retreiveReservation(String reservation_number) {
|
||||
public final Reservation findReservation(String reservation_number) {
|
||||
Reservation rsrv = null;
|
||||
for (Account acct : account_list) {
|
||||
for (Account acct : accounts) {
|
||||
rsrv = acct.findReservation(reservation_number);
|
||||
if( rsrv!=null ) break;
|
||||
}
|
||||
return rsrv;
|
||||
}
|
||||
|
||||
public List<? extends Reservation> getReservationList() {
|
||||
return account_list.getListOfReservations();
|
||||
public List<? extends IReservation> getReservationList() {
|
||||
return accounts.getListOfReservations();
|
||||
}
|
||||
|
||||
public void showReservationList() {
|
||||
for (Reservation rsrv : this.getReservationList()) {
|
||||
System.out.println(String.format("Account %s:, %s", rsrv.getAccountNumber(), rsrv.getReservation_number()));
|
||||
for (IReservation irsrv : this.getReservationList()) {
|
||||
System.out.println(String.format("Account %s: %s, %s", irsrv.getAccountNumber(), irsrv.getReservation_number(), irsrv.getPhysical_address().getStreet()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,21 @@ package lodge.reservationsystem;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
public final class CabinReservation extends Reservation {
|
||||
import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.data.Reservation;
|
||||
|
||||
protected CabinReservation() {
|
||||
setType('C');
|
||||
public final class CabinReservation extends Reservation implements IReservation {
|
||||
|
||||
public CabinReservation() {
|
||||
this.setType('C');
|
||||
this.setNumberOfBeds(1);
|
||||
this.setKitchen(KitchenTypeEnum.Kitchenette);
|
||||
}
|
||||
|
||||
public static Reservation copy(String reservationType) {
|
||||
return new CabinReservation();
|
||||
}
|
||||
|
||||
public CabinReservation(final Address physical_address) {
|
||||
this();
|
||||
@@ -22,8 +30,7 @@ public final class CabinReservation extends Reservation {
|
||||
physical_address.getZip()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String ReservationType() {
|
||||
public String ReservationType() {
|
||||
return "CabinReservation";
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,13 @@ import java.time.LocalTime;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
public final class HotelReservation extends Reservation {
|
||||
import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.data.Reservation;
|
||||
|
||||
protected HotelReservation() {
|
||||
public final class HotelReservation extends Reservation implements IReservation{
|
||||
|
||||
public HotelReservation() {
|
||||
this.setType('H');
|
||||
this.setNumberOfBeds(2);
|
||||
this.setNumberOfBeds(2);
|
||||
@@ -19,6 +23,10 @@ public final class HotelReservation extends Reservation {
|
||||
this.setNumberOfFloors(1);
|
||||
this.setKitchen(KitchenTypeEnum.Kitchenette);
|
||||
}
|
||||
|
||||
public static Reservation copy(String reservationType) {
|
||||
return new HotelReservation();
|
||||
}
|
||||
|
||||
public HotelReservation(final Address physical_address) {
|
||||
this();
|
||||
|
||||
@@ -7,9 +7,13 @@ package lodge.reservationsystem;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
public final class HouseReservation extends Reservation {
|
||||
import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.data.Reservation;
|
||||
|
||||
protected HouseReservation() {
|
||||
public final class HouseReservation extends Reservation implements IReservation {
|
||||
|
||||
public HouseReservation() {
|
||||
this.setType('Z');
|
||||
this.setNumberOfBeds(2);
|
||||
this.setNumberOfBedRooms(1);
|
||||
@@ -18,6 +22,10 @@ public final class HouseReservation extends Reservation {
|
||||
this.setKitchen(KitchenTypeEnum.Kitchenette);
|
||||
}
|
||||
|
||||
public static Reservation copy(String reservationType) {
|
||||
return new HouseReservation();
|
||||
}
|
||||
|
||||
public HouseReservation(final Address physical_address) {
|
||||
this();
|
||||
this.setPhysical_address(
|
||||
|
||||
16
src/java/lodge/reservationsystem/IReservation.java
Normal file
16
src/java/lodge/reservationsystem/IReservation.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package lodge.reservationsystem;
|
||||
|
||||
import lodge.data.Address;
|
||||
import lodge.data.Reservation;
|
||||
|
||||
public interface IReservation {
|
||||
|
||||
public abstract String ReservationType();
|
||||
public static Reservation copy(String type){ return null; };
|
||||
public String getReservation_number();
|
||||
public String getAccountNumber();
|
||||
public Address getPhysical_address();
|
||||
public float getPricePerNight();
|
||||
public float calculatePrice();
|
||||
public boolean checkValid();
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
package lodge.reservationsystem;
|
||||
|
||||
class IllegalOperationException extends RuntimeException {
|
||||
public class IllegalOperationException extends RuntimeException {
|
||||
public IllegalOperationException () {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "Account":{"account_number": "A1450981765","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservation_list":[{"HotelReservation":{"reservation_number":"R0123077641"}},{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}}]}}
|
||||
{ "Account":{"account_number": "A1450981765","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservations":[{"HotelReservation":{"reservation_number":"R0123077641"}},{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}}]}}
|
||||
@@ -1,26 +1 @@
|
||||
{
|
||||
"Account": {
|
||||
"account_number": "A2074212339",
|
||||
"phone_number": "301-356-3890",
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "30 Amstadam ave",
|
||||
"city": "New York",
|
||||
"state": "NY",
|
||||
"zip": "12010"
|
||||
}
|
||||
},
|
||||
"email_address": {
|
||||
"EmailAddress": {
|
||||
"email": "newbee952@aol.com"
|
||||
}
|
||||
},
|
||||
"reservation_list": [
|
||||
{
|
||||
"CabinReservation": {
|
||||
"reservation_number": "R2042828431"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{ "Account":{"account_number": "A2074212339","phone_number": "301-356-3890","mailing_address": { "Address":{"street": "30 Amstadam ave","city": "New York","state": "NY","zip": "12010"}},"email_address": { "EmailAddress":{"email": "newbee952@aol.com"}},"reservations":[{"CabinReservation":{"reservation_number":"R2042828431"}}]}}
|
||||
@@ -1,33 +1 @@
|
||||
{
|
||||
"HouseReservation": {
|
||||
"reservation_type": "HouseReservation",
|
||||
"reservation_number": "R0499811708",
|
||||
"reservation_status": "Completed",
|
||||
"reservation_start_date": "2025-11-05T10:00Z[UTC]",
|
||||
"reservation_end_date": "2025-11-15T22:00Z[UTC]",
|
||||
"account_number": "A1450981765",
|
||||
"physical_address": {
|
||||
"Address": {
|
||||
"street": "3000 Osage ave",
|
||||
"city": "GreenBelt",
|
||||
"state": "MD",
|
||||
"zip": "20740"
|
||||
}
|
||||
},
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "40012 College ave",
|
||||
"city": "College Park",
|
||||
"state": "MD",
|
||||
"zip": "20740"
|
||||
}
|
||||
},
|
||||
"kitchen": "Kitchenette",
|
||||
"numberOfBeds": "4",
|
||||
"numberOfBedRooms": "3",
|
||||
"numberOfBathRooms": "1",
|
||||
"numberOfFloors": "3",
|
||||
"squareFeet": "1400",
|
||||
"price": "1215.0"
|
||||
}
|
||||
}
|
||||
{ "HouseReservation":{"reservation_type": "HouseReservation","reservation_number": "R0499811708","reservation_status": "Completed","reservation_start_date": "2025-11-05T10:00Z[UTC]","reservation_end_date": "2025-11-15T22:00Z[UTC]","account_number": "A1450981765","physical_address": { "Address":{"street": "3000 Osage ave","city": "GreenBelt","state": "MD","zip": "20740"}},"mailing_address": { "Address":{"street": "40012 College ave","city": "College Park","state": "MD","zip": "20740"}},"kitchen": "Kitchenette","numberOfBeds": "4","numberOfBedRooms": "3","numberOfBathRooms": "1","numberOfFloors": "3","squareFeet": "1400","price": "1215.0"}}
|
||||
@@ -1 +1 @@
|
||||
{ "CabinReservation":{"reservation_type": "CabinReservation","reservation_number": "R2042828431","reservation_status": "Draft","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-11-30T22:00Z[UTC]","account_number": "A2074212339","physical_address": { "Address":{"street": "30 cabin ave","city": "Carnelian","state": "CA","zip": "96140"}},"mailing_address": { "Address":{"street": "30 cabin ave","city": "Carnelian Bay","state": "CA","zip": "96140"}},"kitchen": "Kitchenette","numberOfBeds": "4","numberOfBedRooms": "3","numberOfBathRooms": "1","numberOfFloors": "2","squareFeet": "806","price": "10200.0"}}
|
||||
{ "CabinReservation":{"reservation_type": "CabinReservation","reservation_number": "R2042828431","reservation_status": "Canceled","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-11-30T22:00Z[UTC]","account_number": "A2074212339","physical_address": { "Address":{"street": "30 cabin ave","city": "Carnelian","state": "CA","zip": "96140"}},"mailing_address": { "Address":{"street": "30 cabin ave","city": "Carnelian Bay","state": "CA","zip": "96140"}},"kitchen": "Kitchenette","numberOfBeds": "4","numberOfBedRooms": "3","numberOfBathRooms": "1","numberOfFloors": "2","squareFeet": "806","price": "10200.0"}}
|
||||
101
uml/classdiagram.dot
Normal file
101
uml/classdiagram.dot
Normal file
@@ -0,0 +1,101 @@
|
||||
digraph LodgeReservationSystem {
|
||||
// Graph settings
|
||||
rankdir=TB;
|
||||
node [shape=record, fontname="Arial", fontsize=10];
|
||||
edge [fontname="Arial", fontsize=8];
|
||||
|
||||
// Define clusters for packages
|
||||
subgraph cluster_data {
|
||||
label="lodge.data";
|
||||
style=filled;
|
||||
color=lightgrey;
|
||||
|
||||
// Data classes
|
||||
Account [label="{Account|+ account_number: String\l+ phone_number: String\l+ mailing_address: Address\l+ email_address: EmailAddress\l- reservation_list: AccountReservationList\l|+ add(Reservation): boolean\l+ findReservation(String): Reservation\l+ getAllReservations(): ListIterator\<IReservation\>\l+ update(Account): void\l+ Write(Account): void\l}"];
|
||||
|
||||
AccountList [label="{AccountList|extends ArrayList\<Account\>|+ accountSerial(...): String\l+ add(Account): boolean\l+ find(String): Account\l+ save(Account): void\l+ getListOfReservations(): List\<IReservation\>\l}"];
|
||||
|
||||
AccountReservationList [label="{AccountReservationList|extends ArrayList\<IReservation\>|- reservationSerial(Reservation): String\l+ add(IReservation): boolean\l+ find(String): Reservation\l+ update(AccountReservationList): void\l}"];
|
||||
|
||||
Address [label="{Address|+ street: String\l+ city: String\l+ state: String\l+ zip: String\l|+ getters/setters\l+ hashCode(): int\l+ equals(Object): boolean\l}"];
|
||||
|
||||
EmailAddress [label="{EmailAddress|+ email_address: String\l|+ getters/setters\l+ hashCode(): int\l+ equals(Object): boolean\l}"];
|
||||
|
||||
Reservation [label="{Reservation|\<\<abstract\>\>|# type: char\l- reservation_number: String\l- physical_address: Address\l- mailing_address: Address\l- reservation_start_date: ZonedDateTime\l- reservation_end_date: ZonedDateTime\l- reservation_status: ReservationStatusEnum\l- kitchen: KitchenTypeEnum\l- numberOfBeds: Integer\l- numberOfBedRooms: Integer\l- numberOfBathRooms: Integer\l- numberOfFloors: Integer\l- squareFeet: Integer\l- price: Float\l# accountNumber: String\l|+ getters/setters\l+ Write(Reservation): void\l+ Change(Reservation, ReservationStatusEnum): void\l+ update(Reservation): void\l+ \<\<abstract\>\> ReservationType(): String\l}"];
|
||||
|
||||
DataRepository [label="{DataRepository|\<\<singleton\>\>|- directoryPath: String\l- instance: DataRepository\l|+ setDataStoreRoot(String): void\l+ getPath(): String\l+ Reservation(String): Reservation\l+ WalkFileSystemTree(...): void\l+ LoadAccount(Path): Account\l- loadReservation(...): void\l}"];
|
||||
|
||||
DuplicateObjectException [label="{DuplicateObjectException|extends RuntimeException||+ DuplicateObjectException()\l+ DuplicateObjectException(String)\l}"];
|
||||
|
||||
// Enums
|
||||
KitchenTypeEnum [label="{KitchenTypeEnum|\<\<enumeration\>\>|None\lKitchenette\lFullKitchen\l}"];
|
||||
|
||||
ReservationStatusEnum [label="{ReservationStatusEnum|\<\<enumeration\>\>|Draft\lCanceled\lCompleted\l}"];
|
||||
}
|
||||
|
||||
subgraph cluster_reservationsystem {
|
||||
label="lodge.reservationsystem";
|
||||
style=filled;
|
||||
color=lightblue;
|
||||
|
||||
AccomodationManager [label="{AccomodationManager|- accounts: AccountList\l|+ AccomodationManager(String)\l+ loadAll(): void\l+ load(Path): void\l+ retrieveLoadedAccounts(): List\<Account\>\l+ retrieveAccount(String): Account\l+ AddAccount(Account): void\l+ UpdateAccount(Account): void\l+ newAccount(...): Account\l+ addReservation(...): boolean\l+ findReservation(String): Reservation\l+ getReservationList(): List\<IReservation\>\l+ showReservationList(): void\l}"];
|
||||
|
||||
IReservation [label="{IReservation|\<\<interface\>\>||+ ReservationType(): String\l+ getReservation_number(): String\l+ getAccountNumber(): String\l+ getPhysical_address(): Address\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ checkValid(): boolean\l}"];
|
||||
|
||||
HotelReservation [label="{HotelReservation|extends Reservation\limplements IReservation|# type: 'H'\l|+ HotelReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||||
|
||||
CabinReservation [label="{CabinReservation|extends Reservation\limplements IReservation|# type: 'C'\l|+ CabinReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||||
|
||||
HouseReservation [label="{HouseReservation|extends Reservation\limplements IReservation|# type: 'Z'\l|+ HouseReservation(Address)\l+ ReservationType(): String\l+ checkValid(): boolean\l+ getPricePerNight(): float\l+ calculatePrice(): float\l+ Reservation(String): Reservation\l}"];
|
||||
|
||||
IllegalOperationException [label="{IllegalOperationException|extends RuntimeException||+ IllegalOperationException()\l+ IllegalOperationException(String)\l}"];
|
||||
}
|
||||
|
||||
subgraph cluster_main {
|
||||
label="lodge";
|
||||
style=filled;
|
||||
color=lightyellow;
|
||||
|
||||
TestReservations [label="{TestReservations||+ main(String[]): void\l}"];
|
||||
}
|
||||
|
||||
// Relationships
|
||||
|
||||
// Inheritance relationships
|
||||
AccountList -> Account [arrowhead=diamond, label="contains"];
|
||||
AccountReservationList -> IReservation [arrowhead=diamond, label="contains"];
|
||||
|
||||
HotelReservation -> Reservation [arrowhead=empty];
|
||||
CabinReservation -> Reservation [arrowhead=empty];
|
||||
HouseReservation -> Reservation [arrowhead=empty];
|
||||
|
||||
HotelReservation -> IReservation [arrowhead=empty, style=dashed];
|
||||
CabinReservation -> IReservation [arrowhead=empty, style=dashed];
|
||||
HouseReservation -> IReservation [arrowhead=empty, style=dashed];
|
||||
|
||||
// Composition/Aggregation relationships
|
||||
Account -> Address [arrowhead=diamond, label="mailing_address"];
|
||||
Account -> EmailAddress [arrowhead=diamond, label="email_address"];
|
||||
Account -> AccountReservationList [arrowhead=diamond, label="reservation_list"];
|
||||
|
||||
Reservation -> Address [arrowhead=diamond, label="physical_address\nmailing_address"];
|
||||
Reservation -> KitchenTypeEnum [arrowhead=open, label="kitchen"];
|
||||
Reservation -> ReservationStatusEnum [arrowhead=open, label="reservation_status"];
|
||||
|
||||
AccomodationManager -> AccountList [arrowhead=diamond, label="accounts"];
|
||||
AccomodationManager -> DataRepository [arrowhead=open, label="uses"];
|
||||
|
||||
// Usage relationships
|
||||
TestReservations -> AccomodationManager [arrowhead=open, label="uses"];
|
||||
TestReservations -> HotelReservation [arrowhead=open, label="creates"];
|
||||
TestReservations -> CabinReservation [arrowhead=open, label="creates"];
|
||||
TestReservations -> HouseReservation [arrowhead=open, label="creates"];
|
||||
|
||||
DataRepository -> Account [arrowhead=open, label="loads"];
|
||||
DataRepository -> Reservation [arrowhead=open, label="creates"];
|
||||
|
||||
// Exception relationships
|
||||
AccountList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"];
|
||||
AccountReservationList -> DuplicateObjectException [arrowhead=open, style=dashed, label="throws"];
|
||||
Reservation -> IllegalOperationException [arrowhead=open, style=dashed, label="throws"];
|
||||
}
|
||||
465
uml/classdiagram.svg
Normal file
465
uml/classdiagram.svg
Normal file
@@ -0,0 +1,465 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1791pt" height="1094pt" viewBox="0.00 0.00 1791 1094.2">
|
||||
<g id="graph0" class="graph" transform="translate(4,1090.199951171875) scale(1)" data-name="LodgeReservationSystem">
|
||||
|
||||
<polygon fill="white" stroke="none" points="-4,4 -4,-1090.2 1787,-1090.2 1787,4 -4,4"/>
|
||||
<g id="clust1" class="cluster" data-name="cluster_data">
|
||||
|
||||
<polygon fill="lightgrey" stroke="lightgrey" points="994,-8 994,-904 1775,-904 1775,-8 994,-8" style=""/>
|
||||
<text text-anchor="middle" x="1384.5" y="-887.4" font-family="Times,serif" font-size="14.00" style="">lodge.data</text>
|
||||
</g>
|
||||
<g id="clust2" class="cluster" data-name="cluster_reservationsystem">
|
||||
|
||||
<polygon fill="lightblue" stroke="lightblue" points="8,-394.8 8,-924 986,-924 986,-394.8 8,-394.8" style=""/>
|
||||
<text text-anchor="middle" x="497" y="-907.4" font-family="Times,serif" font-size="14.00" style="">lodge.reservationsystem</text>
|
||||
</g>
|
||||
<g id="clust3" class="cluster" data-name="cluster_main">
|
||||
|
||||
<polygon fill="lightyellow" stroke="lightyellow" points="303,-951.6 303,-1078.2 427,-1078.2 427,-951.6 303,-951.6" style=""/>
|
||||
<text text-anchor="middle" x="365" y="-1061.6" font-family="Times,serif" font-size="14.00" style="">lodge</text>
|
||||
</g>
|
||||
<!-- Account -->
|
||||
<g id="node1" class="node" pointer-events="visible" data-name="Account">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1276.37,-401.3 1276.37,-557.3 1511.63,-557.3 1511.63,-401.3 1276.37,-401.3"/>
|
||||
<text text-anchor="middle" x="1394" y="-544.3" font-family="Arial" font-size="10.00">Account</text>
|
||||
<polyline fill="none" stroke="black" points="1276.37,-537.3 1511.63,-537.3"/>
|
||||
<text text-anchor="start" x="1284.37" y="-524.3" font-family="Arial" font-size="10.00">+ account_number: String</text>
|
||||
<text text-anchor="start" x="1284.37" y="-512.3" font-family="Arial" font-size="10.00">+ phone_number: String</text>
|
||||
<text text-anchor="start" x="1284.37" y="-500.3" font-family="Arial" font-size="10.00">+ mailing_address: Address</text>
|
||||
<text text-anchor="start" x="1284.37" y="-488.3" font-family="Arial" font-size="10.00">+ email_address: EmailAddress</text>
|
||||
<text text-anchor="start" x="1284.37" y="-476.3" font-family="Arial" font-size="10.00">- reservation_list: AccountReservationList</text>
|
||||
<polyline fill="none" stroke="black" points="1276.37,-469.3 1511.63,-469.3"/>
|
||||
<text text-anchor="start" x="1284.37" y="-456.3" font-family="Arial" font-size="10.00">+ add(Reservation): boolean</text>
|
||||
<text text-anchor="start" x="1284.37" y="-444.3" font-family="Arial" font-size="10.00">+ findReservation(String): Reservation</text>
|
||||
<text text-anchor="start" x="1284.37" y="-432.3" font-family="Arial" font-size="10.00">+ getAllReservations(): ListIterator<IReservation></text>
|
||||
<text text-anchor="start" x="1284.37" y="-420.3" font-family="Arial" font-size="10.00">+ update(Account): void</text>
|
||||
<text text-anchor="start" x="1284.37" y="-408.3" font-family="Arial" font-size="10.00">+ Write(Account): void</text>
|
||||
</g>
|
||||
<!-- AccountReservationList --><g id="edge11" class="edge" data-name="Account->AccountReservationList" data-comment="AccountReservationList">
|
||||
|
||||
<path fill="none" stroke="black" d="M1378.25,-401.44C1368.19,-365.99 1352.34,-324.93 1328,-293.6 1321.55,-285.29 1313.94,-277.56 1305.78,-270.46"/>
|
||||
<polygon fill="black" stroke="black" points="1305.98,-270.62 1298.8,-269.89 1296.72,-262.99 1303.89,-263.72 1305.98,-270.62"/>
|
||||
<text text-anchor="middle" x="1366.9" y="-300.8" font-family="Arial" font-size="8.00">reservation_list</text>
|
||||
</g>
|
||||
<g id="node3" class="node" pointer-events="visible" data-name="AccountReservationList">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1117.59,-167.1 1117.59,-263.1 1308.41,-263.1 1308.41,-167.1 1117.59,-167.1"/>
|
||||
<text text-anchor="middle" x="1213" y="-250.1" font-family="Arial" font-size="10.00">AccountReservationList</text>
|
||||
<polyline fill="none" stroke="black" points="1117.59,-243.1 1308.41,-243.1"/>
|
||||
<text text-anchor="middle" x="1213" y="-230.1" font-family="Arial" font-size="10.00">extends ArrayList<IReservation></text>
|
||||
<polyline fill="none" stroke="black" points="1117.59,-223.1 1308.41,-223.1"/>
|
||||
<text text-anchor="start" x="1125.59" y="-210.1" font-family="Arial" font-size="10.00">- reservationSerial(Reservation): String</text>
|
||||
<text text-anchor="start" x="1125.59" y="-198.1" font-family="Arial" font-size="10.00">+ add(IReservation): boolean</text>
|
||||
<text text-anchor="start" x="1125.59" y="-186.1" font-family="Arial" font-size="10.00">+ find(String): Reservation</text>
|
||||
<text text-anchor="start" x="1125.59" y="-174.1" font-family="Arial" font-size="10.00">+ update(AccountReservationList): void</text>
|
||||
</g>
|
||||
<!-- Account->AccountReservationList -->
|
||||
|
||||
<!-- Address --><g id="edge9" class="edge" data-name="Account->Address" data-comment="Address">
|
||||
|
||||
<path fill="none" stroke="black" d="M1434.62,-401.45C1452.17,-368.26 1472.95,-329.01 1491.75,-293.6 1493.2,-290.85 1494.69,-288.06 1496.19,-285.23"/>
|
||||
<polygon fill="black" stroke="black" points="1496.04,-285.51 1495.33,-278.33 1501.68,-274.91 1502.39,-282.09 1496.04,-285.51"/>
|
||||
<text text-anchor="middle" x="1520.13" y="-300.8" font-family="Arial" font-size="8.00">mailing_address</text>
|
||||
</g>
|
||||
<g id="node4" class="node" pointer-events="visible" data-name="Address">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1467.6,-155.1 1467.6,-275.1 1598.4,-275.1 1598.4,-155.1 1467.6,-155.1"/>
|
||||
<text text-anchor="middle" x="1533" y="-262.1" font-family="Arial" font-size="10.00">Address</text>
|
||||
<polyline fill="none" stroke="black" points="1467.6,-255.1 1598.4,-255.1"/>
|
||||
<text text-anchor="start" x="1475.6" y="-242.1" font-family="Arial" font-size="10.00">+ street: String</text>
|
||||
<text text-anchor="start" x="1475.6" y="-230.1" font-family="Arial" font-size="10.00">+ city: String</text>
|
||||
<text text-anchor="start" x="1475.6" y="-218.1" font-family="Arial" font-size="10.00">+ state: String</text>
|
||||
<text text-anchor="start" x="1475.6" y="-206.1" font-family="Arial" font-size="10.00">+ zip: String</text>
|
||||
<polyline fill="none" stroke="black" points="1467.6,-199.1 1598.4,-199.1"/>
|
||||
<text text-anchor="start" x="1475.6" y="-186.1" font-family="Arial" font-size="10.00">+ getters/setters</text>
|
||||
<text text-anchor="start" x="1475.6" y="-174.1" font-family="Arial" font-size="10.00">+ hashCode(): int</text>
|
||||
<text text-anchor="start" x="1475.6" y="-162.1" font-family="Arial" font-size="10.00">+ equals(Object): boolean</text>
|
||||
</g>
|
||||
<!-- Account->Address -->
|
||||
|
||||
<!-- EmailAddress --><g id="edge10" class="edge" data-name="Account->EmailAddress" data-comment="EmailAddress">
|
||||
|
||||
<path fill="none" stroke="black" d="M1478.46,-401.4C1526.96,-357.25 1586.4,-303.13 1628.49,-264.81"/>
|
||||
<polygon fill="black" stroke="black" points="1628.33,-264.96 1630.07,-257.97 1637.2,-256.88 1635.46,-263.88 1628.33,-264.96"/>
|
||||
<text text-anchor="middle" x="1614.01" y="-300.8" font-family="Arial" font-size="8.00">email_address</text>
|
||||
</g>
|
||||
<g id="node5" class="node" pointer-events="visible" data-name="EmailAddress">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1616.6,-173.1 1616.6,-257.1 1747.4,-257.1 1747.4,-173.1 1616.6,-173.1"/>
|
||||
<text text-anchor="middle" x="1682" y="-244.1" font-family="Arial" font-size="10.00">EmailAddress</text>
|
||||
<polyline fill="none" stroke="black" points="1616.6,-237.1 1747.4,-237.1"/>
|
||||
<text text-anchor="start" x="1624.6" y="-224.1" font-family="Arial" font-size="10.00">+ email_address: String</text>
|
||||
<polyline fill="none" stroke="black" points="1616.6,-217.1 1747.4,-217.1"/>
|
||||
<text text-anchor="start" x="1624.6" y="-204.1" font-family="Arial" font-size="10.00">+ getters/setters</text>
|
||||
<text text-anchor="start" x="1624.6" y="-192.1" font-family="Arial" font-size="10.00">+ hashCode(): int</text>
|
||||
<text text-anchor="start" x="1624.6" y="-180.1" font-family="Arial" font-size="10.00">+ equals(Object): boolean</text>
|
||||
</g>
|
||||
<!-- Account->EmailAddress -->
|
||||
|
||||
<!-- AccountList --><g id="edge1" class="edge" data-name="AccountList->Account" data-comment="AccountList">
|
||||
|
||||
<path fill="none" stroke="black" d="M1349.9,-715.97C1357.6,-674.85 1368.44,-616.92 1377.44,-568.79"/>
|
||||
<polygon fill="black" stroke="black" points="1377.42,-568.89 1374.6,-562.26 1379.63,-557.1 1382.46,-563.73 1377.42,-568.89"/>
|
||||
<text text-anchor="middle" x="1376.9" y="-648.2" font-family="Arial" font-size="8.00">contains</text>
|
||||
</g>
|
||||
<g id="node2" class="node" pointer-events="visible" data-name="AccountList">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1230.7,-715.9 1230.7,-823.9 1449.3,-823.9 1449.3,-715.9 1230.7,-715.9"/>
|
||||
<text text-anchor="middle" x="1340" y="-810.9" font-family="Arial" font-size="10.00">AccountList</text>
|
||||
<polyline fill="none" stroke="black" points="1230.7,-803.9 1449.3,-803.9"/>
|
||||
<text text-anchor="middle" x="1340" y="-790.9" font-family="Arial" font-size="10.00">extends ArrayList<Account></text>
|
||||
<polyline fill="none" stroke="black" points="1230.7,-783.9 1449.3,-783.9"/>
|
||||
<text text-anchor="start" x="1238.7" y="-770.9" font-family="Arial" font-size="10.00">+ accountSerial(...): String</text>
|
||||
<text text-anchor="start" x="1238.7" y="-758.9" font-family="Arial" font-size="10.00">+ add(Account): boolean</text>
|
||||
<text text-anchor="start" x="1238.7" y="-746.9" font-family="Arial" font-size="10.00">+ find(String): Account</text>
|
||||
<text text-anchor="start" x="1238.7" y="-734.9" font-family="Arial" font-size="10.00">+ save(Account): void</text>
|
||||
<text text-anchor="start" x="1238.7" y="-722.9" font-family="Arial" font-size="10.00">+ getListOfReservations(): List<IReservation></text>
|
||||
</g>
|
||||
<!-- AccountList->Account -->
|
||||
|
||||
<!-- DuplicateObjectException --><g id="edge23" class="edge" data-name="AccountList->DuplicateObjectException" data-comment="DuplicateObjectException">
|
||||
|
||||
<path fill="none" stroke="black" d="M1418.55,-716.23C1452.19,-691.59 1490.63,-660.5 1521,-627.8 1649.07,-489.92 1701.43,-455.69 1756,-275.6 1771.59,-224.13 1788.2,-197.67 1756,-154.6 1730.17,-120.06 1623.31,-94.07 1542.43,-78.87" stroke-dasharray="5,2"/>
|
||||
<polygon fill="black" stroke="black" points="1532.7,-77.07 1543.35,-74.46 1537.62,-77.98 1542.53,-78.89 1542.53,-78.89 1542.53,-78.89 1537.62,-77.98 1541.71,-83.31 1532.7,-77.07 1532.7,-77.07"/>
|
||||
<text text-anchor="middle" x="1760.78" y="-300.8" font-family="Arial" font-size="8.00">throws</text>
|
||||
</g>
|
||||
<g id="node8" class="node" pointer-events="visible" data-name="DuplicateObjectException">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1361.05,-16.5 1361.05,-108.5 1532.95,-108.5 1532.95,-16.5 1361.05,-16.5"/>
|
||||
<text text-anchor="middle" x="1447" y="-95.5" font-family="Arial" font-size="10.00">DuplicateObjectException</text>
|
||||
<polyline fill="none" stroke="black" points="1361.05,-88.5 1532.95,-88.5"/>
|
||||
<text text-anchor="middle" x="1447" y="-75.5" font-family="Arial" font-size="10.00">extends RuntimeException</text>
|
||||
<polyline fill="none" stroke="black" points="1361.05,-68.5 1532.95,-68.5"/>
|
||||
<text text-anchor="middle" x="1447" y="-55.5" font-family="Arial" font-size="10.00"> </text>
|
||||
<polyline fill="none" stroke="black" points="1361.05,-48.5 1532.95,-48.5"/>
|
||||
<text text-anchor="start" x="1369.05" y="-35.5" font-family="Arial" font-size="10.00">+ DuplicateObjectException()</text>
|
||||
<text text-anchor="start" x="1369.05" y="-23.5" font-family="Arial" font-size="10.00">+ DuplicateObjectException(String)</text>
|
||||
</g>
|
||||
<!-- AccountList->DuplicateObjectException --><g id="edge24" class="edge" data-name="AccountReservationList->DuplicateObjectException" data-comment="AccountList->DuplicateObjectException">
|
||||
|
||||
<path fill="none" stroke="black" d="M1285.76,-167.27C1312.14,-150.29 1342.04,-131.05 1368.87,-113.78" stroke-dasharray="5,2"/>
|
||||
<polygon fill="black" stroke="black" points="1377.09,-108.49 1371.12,-117.69 1372.89,-111.2 1368.68,-113.9 1368.68,-113.9 1368.68,-113.9 1372.89,-111.2 1366.25,-110.12 1377.09,-108.49 1377.09,-108.49"/>
|
||||
<text text-anchor="middle" x="1355.78" y="-129.4" font-family="Arial" font-size="8.00">throws</text>
|
||||
</g>
|
||||
|
||||
<!-- AccountReservationList->DuplicateObjectException -->
|
||||
|
||||
<!-- IReservation --><g id="edge2" class="edge" data-name="AccountReservationList->IReservation" data-comment="IReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M1136.01,-263.01C1127.07,-267.6 1117.94,-271.91 1109,-275.6 1080.58,-287.33 1071.28,-283.61 1042.2,-293.6 921.72,-335.01 787.27,-393.61 699.46,-433.63"/>
|
||||
<polygon fill="black" stroke="black" points="699.64,-433.55 695.84,-439.68 688.72,-438.53 692.52,-432.4 699.64,-433.55"/>
|
||||
<text text-anchor="middle" x="1056.9" y="-300.8" font-family="Arial" font-size="8.00">contains</text>
|
||||
</g>
|
||||
<g id="node12" class="node" pointer-events="visible" data-name="IReservation">
|
||||
|
||||
<polygon fill="none" stroke="black" points="519.16,-403.3 519.16,-555.3 688.84,-555.3 688.84,-403.3 519.16,-403.3"/>
|
||||
<text text-anchor="middle" x="604" y="-542.3" font-family="Arial" font-size="10.00">IReservation</text>
|
||||
<polyline fill="none" stroke="black" points="519.16,-535.3 688.84,-535.3"/>
|
||||
<text text-anchor="middle" x="604" y="-522.3" font-family="Arial" font-size="10.00"><<interface>></text>
|
||||
<polyline fill="none" stroke="black" points="519.16,-515.3 688.84,-515.3"/>
|
||||
<text text-anchor="middle" x="604" y="-502.3" font-family="Arial" font-size="10.00"> </text>
|
||||
<polyline fill="none" stroke="black" points="519.16,-495.3 688.84,-495.3"/>
|
||||
<text text-anchor="start" x="527.16" y="-482.3" font-family="Arial" font-size="10.00">+ ReservationType(): String</text>
|
||||
<text text-anchor="start" x="527.16" y="-470.3" font-family="Arial" font-size="10.00">+ getReservation_number(): String</text>
|
||||
<text text-anchor="start" x="527.16" y="-458.3" font-family="Arial" font-size="10.00">+ getAccountNumber(): String</text>
|
||||
<text text-anchor="start" x="527.16" y="-446.3" font-family="Arial" font-size="10.00">+ getPhysical_address(): Address</text>
|
||||
<text text-anchor="start" x="527.16" y="-434.3" font-family="Arial" font-size="10.00">+ getPricePerNight(): float</text>
|
||||
<text text-anchor="start" x="527.16" y="-422.3" font-family="Arial" font-size="10.00">+ calculatePrice(): float</text>
|
||||
<text text-anchor="start" x="527.16" y="-410.3" font-family="Arial" font-size="10.00">+ checkValid(): boolean</text>
|
||||
</g>
|
||||
<!-- AccountReservationList->IReservation -->
|
||||
|
||||
<!-- Reservation --><g id="edge12" class="edge" data-name="Reservation->Address" data-comment="Reservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M1224.41,-331.32C1238.36,-313.65 1251.58,-299.68 1262.19,-293.6 1335.2,-251.76 1374.21,-303.78 1456.55,-275.8"/>
|
||||
<polygon fill="black" stroke="black" points="1456.39,-275.86 1460.61,-270.01 1467.63,-271.65 1463.41,-277.5 1456.39,-275.86"/>
|
||||
<text text-anchor="middle" x="1292.91" y="-305.6" font-family="Arial" font-size="8.00">physical_address</text>
|
||||
<text text-anchor="middle" x="1292.91" y="-296" font-family="Arial" font-size="8.00">mailing_address</text>
|
||||
</g>
|
||||
<g id="node6" class="node" pointer-events="visible" data-name="Reservation">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1001.52,-331.3 1001.52,-627.3 1258.48,-627.3 1258.48,-331.3 1001.52,-331.3"/>
|
||||
<text text-anchor="middle" x="1130" y="-614.3" font-family="Arial" font-size="10.00">Reservation</text>
|
||||
<polyline fill="none" stroke="black" points="1001.52,-607.3 1258.48,-607.3"/>
|
||||
<text text-anchor="middle" x="1130" y="-594.3" font-family="Arial" font-size="10.00"><<abstract>></text>
|
||||
<polyline fill="none" stroke="black" points="1001.52,-587.3 1258.48,-587.3"/>
|
||||
<text text-anchor="start" x="1009.52" y="-574.3" font-family="Arial" font-size="10.00"># type: char</text>
|
||||
<text text-anchor="start" x="1009.52" y="-562.3" font-family="Arial" font-size="10.00">- reservation_number: String</text>
|
||||
<text text-anchor="start" x="1009.52" y="-550.3" font-family="Arial" font-size="10.00">- physical_address: Address</text>
|
||||
<text text-anchor="start" x="1009.52" y="-538.3" font-family="Arial" font-size="10.00">- mailing_address: Address</text>
|
||||
<text text-anchor="start" x="1009.52" y="-526.3" font-family="Arial" font-size="10.00">- reservation_start_date: ZonedDateTime</text>
|
||||
<text text-anchor="start" x="1009.52" y="-514.3" font-family="Arial" font-size="10.00">- reservation_end_date: ZonedDateTime</text>
|
||||
<text text-anchor="start" x="1009.52" y="-502.3" font-family="Arial" font-size="10.00">- reservation_status: ReservationStatusEnum</text>
|
||||
<text text-anchor="start" x="1009.52" y="-490.3" font-family="Arial" font-size="10.00">- kitchen: KitchenTypeEnum</text>
|
||||
<text text-anchor="start" x="1009.52" y="-478.3" font-family="Arial" font-size="10.00">- numberOfBeds: Integer</text>
|
||||
<text text-anchor="start" x="1009.52" y="-466.3" font-family="Arial" font-size="10.00">- numberOfBedRooms: Integer</text>
|
||||
<text text-anchor="start" x="1009.52" y="-454.3" font-family="Arial" font-size="10.00">- numberOfBathRooms: Integer</text>
|
||||
<text text-anchor="start" x="1009.52" y="-442.3" font-family="Arial" font-size="10.00">- numberOfFloors: Integer</text>
|
||||
<text text-anchor="start" x="1009.52" y="-430.3" font-family="Arial" font-size="10.00">- squareFeet: Integer</text>
|
||||
<text text-anchor="start" x="1009.52" y="-418.3" font-family="Arial" font-size="10.00">- price: Float</text>
|
||||
<text text-anchor="start" x="1009.52" y="-406.3" font-family="Arial" font-size="10.00"># accountNumber: String</text>
|
||||
<polyline fill="none" stroke="black" points="1001.52,-399.3 1258.48,-399.3"/>
|
||||
<text text-anchor="start" x="1009.52" y="-386.3" font-family="Arial" font-size="10.00">+ getters/setters</text>
|
||||
<text text-anchor="start" x="1009.52" y="-374.3" font-family="Arial" font-size="10.00">+ Write(Reservation): void</text>
|
||||
<text text-anchor="start" x="1009.52" y="-362.3" font-family="Arial" font-size="10.00">+ Change(Reservation, ReservationStatusEnum): void</text>
|
||||
<text text-anchor="start" x="1009.52" y="-350.3" font-family="Arial" font-size="10.00">+ update(Reservation): void</text>
|
||||
<text text-anchor="start" x="1009.52" y="-338.3" font-family="Arial" font-size="10.00">+ <<abstract>> ReservationType(): String</text>
|
||||
</g>
|
||||
<!-- Reservation->Address -->
|
||||
<!-- Reservation->KitchenTypeEnum -->
|
||||
<!-- KitchenTypeEnum --><g id="edge13" class="edge" data-name="Reservation->KitchenTypeEnum" data-comment="KitchenTypeEnum">
|
||||
|
||||
<path fill="none" stroke="black" d="M1085.77,-331.49C1078.74,-308.17 1071.92,-285.52 1066.2,-266.56"/>
|
||||
<polygon fill="black" stroke="black" points="1063.32,-256.99 1070.51,-265.27 1064.76,-261.78 1066.21,-266.57 1066.21,-266.57 1066.21,-266.57 1064.76,-261.78 1061.9,-267.87 1063.32,-256.99 1063.32,-256.99"/>
|
||||
<text text-anchor="middle" x="1090.67" y="-300.8" font-family="Arial" font-size="8.00">kitchen</text>
|
||||
</g>
|
||||
<g id="node9" class="node" pointer-events="visible" data-name="KitchenTypeEnum">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1002.15,-173.1 1002.15,-257.1 1099.85,-257.1 1099.85,-173.1 1002.15,-173.1"/>
|
||||
<text text-anchor="middle" x="1051" y="-244.1" font-family="Arial" font-size="10.00">KitchenTypeEnum</text>
|
||||
<polyline fill="none" stroke="black" points="1002.15,-237.1 1099.85,-237.1"/>
|
||||
<text text-anchor="middle" x="1051" y="-224.1" font-family="Arial" font-size="10.00"><<enumeration>></text>
|
||||
<polyline fill="none" stroke="black" points="1002.15,-217.1 1099.85,-217.1"/>
|
||||
<text text-anchor="start" x="1010.15" y="-204.1" font-family="Arial" font-size="10.00">None</text>
|
||||
<text text-anchor="start" x="1010.15" y="-192.1" font-family="Arial" font-size="10.00">Kitchenette</text>
|
||||
<text text-anchor="start" x="1010.15" y="-180.1" font-family="Arial" font-size="10.00">FullKitchen</text>
|
||||
</g><!-- ReservationStatusEnum -->
|
||||
<g id="node10" class="node" pointer-events="visible" data-name="ReservationStatusEnum">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1326.08,-173.1 1326.08,-257.1 1449.92,-257.1 1449.92,-173.1 1326.08,-173.1"/>
|
||||
<text text-anchor="middle" x="1388" y="-244.1" font-family="Arial" font-size="10.00">ReservationStatusEnum</text>
|
||||
<polyline fill="none" stroke="black" points="1326.08,-237.1 1449.92,-237.1"/>
|
||||
<text text-anchor="middle" x="1388" y="-224.1" font-family="Arial" font-size="10.00"><<enumeration>></text>
|
||||
<polyline fill="none" stroke="black" points="1326.08,-217.1 1449.92,-217.1"/>
|
||||
<text text-anchor="start" x="1334.08" y="-204.1" font-family="Arial" font-size="10.00">Draft</text>
|
||||
<text text-anchor="start" x="1334.08" y="-192.1" font-family="Arial" font-size="10.00">Canceled</text>
|
||||
<text text-anchor="start" x="1334.08" y="-180.1" font-family="Arial" font-size="10.00">Completed</text>
|
||||
</g>
|
||||
<!-- Reservation->ReservationStatusEnum -->
|
||||
<g id="edge14" class="edge" data-name="Reservation->ReservationStatusEnum">
|
||||
|
||||
<path fill="none" stroke="black" d="M1147.14,-331.55C1153.88,-317.25 1162.83,-304.16 1174.63,-293.6 1222.17,-251.08 1258.55,-301.12 1317,-275.6 1324.79,-272.2 1332.4,-267.66 1339.55,-262.61"/>
|
||||
<polygon fill="black" stroke="black" points="1347.14,-256.95 1341.82,-266.54 1343.13,-259.94 1339.12,-262.93 1339.12,-262.93 1339.12,-262.93 1343.13,-259.94 1336.43,-259.32 1347.14,-256.95 1347.14,-256.95"/>
|
||||
<text text-anchor="middle" x="1206.68" y="-300.8" font-family="Arial" font-size="8.00">reservation_status</text>
|
||||
</g>
|
||||
<!-- IllegalOperationException -->
|
||||
<g id="node16" class="node" pointer-events="visible" data-name="IllegalOperationException">
|
||||
|
||||
<polygon fill="none" stroke="black" points="806.32,-723.9 806.32,-815.9 977.68,-815.9 977.68,-723.9 806.32,-723.9"/>
|
||||
<text text-anchor="middle" x="892" y="-802.9" font-family="Arial" font-size="10.00">IllegalOperationException</text>
|
||||
<polyline fill="none" stroke="black" points="806.32,-795.9 977.68,-795.9"/>
|
||||
<text text-anchor="middle" x="892" y="-782.9" font-family="Arial" font-size="10.00">extends RuntimeException</text>
|
||||
<polyline fill="none" stroke="black" points="806.32,-775.9 977.68,-775.9"/>
|
||||
<text text-anchor="middle" x="892" y="-762.9" font-family="Arial" font-size="10.00"> </text>
|
||||
<polyline fill="none" stroke="black" points="806.32,-755.9 977.68,-755.9"/>
|
||||
<text text-anchor="start" x="814.32" y="-742.9" font-family="Arial" font-size="10.00">+ IllegalOperationException()</text>
|
||||
<text text-anchor="start" x="814.32" y="-730.9" font-family="Arial" font-size="10.00">+ IllegalOperationException(String)</text>
|
||||
</g>
|
||||
<!-- Reservation->IllegalOperationException -->
|
||||
<g id="edge25" class="edge" data-name="Reservation->IllegalOperationException">
|
||||
|
||||
<path fill="none" stroke="black" d="M1008.85,-627.21C982.44,-659.24 956.16,-691.09 935.24,-716.46" stroke-dasharray="5,2"/>
|
||||
<polygon fill="black" stroke="black" points="928.93,-724.12 931.82,-713.54 932.11,-720.27 935.29,-716.41 935.29,-716.41 935.29,-716.41 932.11,-720.27 938.76,-719.27 928.93,-724.12 928.93,-724.12"/>
|
||||
<text text-anchor="middle" x="1000.78" y="-648.2" font-family="Arial" font-size="8.00">throws</text>
|
||||
</g>
|
||||
<!-- DataRepository -->
|
||||
<g id="node7" class="node" pointer-events="visible" data-name="DataRepository">
|
||||
|
||||
<polygon fill="none" stroke="black" points="1013.16,-693.9 1013.16,-845.9 1182.84,-845.9 1182.84,-693.9 1013.16,-693.9"/>
|
||||
<text text-anchor="middle" x="1098" y="-832.9" font-family="Arial" font-size="10.00">DataRepository</text>
|
||||
<polyline fill="none" stroke="black" points="1013.16,-825.9 1182.84,-825.9"/>
|
||||
<text text-anchor="middle" x="1098" y="-812.9" font-family="Arial" font-size="10.00"><<singleton>></text>
|
||||
<polyline fill="none" stroke="black" points="1013.16,-805.9 1182.84,-805.9"/>
|
||||
<text text-anchor="start" x="1021.16" y="-792.9" font-family="Arial" font-size="10.00">- directoryPath: String</text>
|
||||
<text text-anchor="start" x="1021.16" y="-780.9" font-family="Arial" font-size="10.00">- instance: DataRepository</text>
|
||||
<polyline fill="none" stroke="black" points="1013.16,-773.9 1182.84,-773.9"/>
|
||||
<text text-anchor="start" x="1021.16" y="-760.9" font-family="Arial" font-size="10.00">+ setDataStoreRoot(String): void</text>
|
||||
<text text-anchor="start" x="1021.16" y="-748.9" font-family="Arial" font-size="10.00">+ getPath(): String</text>
|
||||
<text text-anchor="start" x="1021.16" y="-736.9" font-family="Arial" font-size="10.00">+ Reservation(String): Reservation</text>
|
||||
<text text-anchor="start" x="1021.16" y="-724.9" font-family="Arial" font-size="10.00">+ WalkFileSystemTree(...): void</text>
|
||||
<text text-anchor="start" x="1021.16" y="-712.9" font-family="Arial" font-size="10.00">+ LoadAccount(Path): Account</text>
|
||||
<text text-anchor="start" x="1021.16" y="-700.9" font-family="Arial" font-size="10.00">- loadReservation(...): void</text>
|
||||
</g>
|
||||
<!-- DataRepository->Account -->
|
||||
<g id="edge21" class="edge" data-name="DataRepository->Account">
|
||||
|
||||
<path fill="none" stroke="black" d="M1182.46,-702.97C1210.24,-680.1 1240.72,-653.68 1267,-627.8 1286.92,-608.18 1307.23,-585.83 1325.6,-564.57"/>
|
||||
<polygon fill="black" stroke="black" points="1332.01,-557.1 1328.91,-567.62 1328.75,-560.9 1325.5,-564.69 1325.5,-564.69 1325.5,-564.69 1328.75,-560.9 1322.08,-561.76 1332.01,-557.1 1332.01,-557.1"/>
|
||||
<text text-anchor="middle" x="1254.56" y="-648.2" font-family="Arial" font-size="8.00">loads</text>
|
||||
</g>
|
||||
<!-- DataRepository->Reservation -->
|
||||
<g id="edge22" class="edge" data-name="DataRepository->Reservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M1106.28,-694.2C1108.25,-676.48 1110.42,-656.91 1112.62,-637.02"/>
|
||||
<polygon fill="black" stroke="black" points="1113.71,-627.24 1117.08,-637.68 1113.16,-632.21 1112.6,-637.18 1112.6,-637.18 1112.6,-637.18 1113.16,-632.21 1108.13,-636.69 1113.71,-627.24 1113.71,-627.24"/>
|
||||
<text text-anchor="middle" x="1124.12" y="-648.2" font-family="Arial" font-size="8.00">creates</text>
|
||||
</g>
|
||||
<!-- AccomodationManager -->
|
||||
<g id="node11" class="node" pointer-events="visible" data-name="AccomodationManager">
|
||||
|
||||
<polygon fill="none" stroke="black" points="15.97,-673.9 15.97,-865.9 224.03,-865.9 224.03,-673.9 15.97,-673.9"/>
|
||||
<text text-anchor="middle" x="120" y="-852.9" font-family="Arial" font-size="10.00">AccomodationManager</text>
|
||||
<polyline fill="none" stroke="black" points="15.97,-845.9 224.03,-845.9"/>
|
||||
<text text-anchor="start" x="23.97" y="-832.9" font-family="Arial" font-size="10.00">- accounts: AccountList</text>
|
||||
<polyline fill="none" stroke="black" points="15.97,-825.9 224.03,-825.9"/>
|
||||
<text text-anchor="start" x="23.97" y="-812.9" font-family="Arial" font-size="10.00">+ AccomodationManager(String)</text>
|
||||
<text text-anchor="start" x="23.97" y="-800.9" font-family="Arial" font-size="10.00">+ loadAll(): void</text>
|
||||
<text text-anchor="start" x="23.97" y="-788.9" font-family="Arial" font-size="10.00">+ load(Path): void</text>
|
||||
<text text-anchor="start" x="23.97" y="-776.9" font-family="Arial" font-size="10.00">+ retrieveLoadedAccounts(): List<Account></text>
|
||||
<text text-anchor="start" x="23.97" y="-764.9" font-family="Arial" font-size="10.00">+ retrieveAccount(String): Account</text>
|
||||
<text text-anchor="start" x="23.97" y="-752.9" font-family="Arial" font-size="10.00">+ AddAccount(Account): void</text>
|
||||
<text text-anchor="start" x="23.97" y="-740.9" font-family="Arial" font-size="10.00">+ UpdateAccount(Account): void</text>
|
||||
<text text-anchor="start" x="23.97" y="-728.9" font-family="Arial" font-size="10.00">+ newAccount(...): Account</text>
|
||||
<text text-anchor="start" x="23.97" y="-716.9" font-family="Arial" font-size="10.00">+ addReservation(...): boolean</text>
|
||||
<text text-anchor="start" x="23.97" y="-704.9" font-family="Arial" font-size="10.00">+ findReservation(String): Reservation</text>
|
||||
<text text-anchor="start" x="23.97" y="-692.9" font-family="Arial" font-size="10.00">+ getReservationList(): List<IReservation></text>
|
||||
<text text-anchor="start" x="23.97" y="-680.9" font-family="Arial" font-size="10.00">+ showReservationList(): void</text>
|
||||
</g>
|
||||
<!-- AccomodationManager->AccountList -->
|
||||
<g id="edge15" class="edge" data-name="AccomodationManager->AccountList">
|
||||
|
||||
<path fill="none" stroke="black" d="M181.97,-865.64C196.7,-881.27 213.8,-895.25 233,-904.18 329.6,-949.15 1092.59,-942.56 1192,-904.18 1230.13,-889.46 1264.51,-859.85 1290.52,-832.17"/>
|
||||
<polygon fill="black" stroke="black" points="1290.21,-832.51 1291.31,-825.38 1298.31,-823.66 1297.21,-830.79 1290.21,-832.51"/>
|
||||
<text text-anchor="middle" x="602" y="-934.4" font-family="Arial" font-size="8.00">accounts</text>
|
||||
</g>
|
||||
<!-- AccomodationManager->DataRepository -->
|
||||
<g id="edge16" class="edge" data-name="AccomodationManager->DataRepository">
|
||||
|
||||
<path fill="none" stroke="black" d="M181.97,-865.64C196.7,-881.27 213.8,-895.25 233,-904.18 309.26,-939.68 914.14,-940.52 990,-904.18 1013.45,-892.95 1033.42,-873.87 1049.58,-853.57"/>
|
||||
<polygon fill="black" stroke="black" points="1055.58,-845.74 1053.06,-856.41 1052.54,-849.71 1049.49,-853.67 1049.49,-853.67 1049.49,-853.67 1052.54,-849.71 1045.92,-850.94 1055.58,-845.74 1055.58,-845.74"/>
|
||||
<text text-anchor="middle" x="464" y="-934.4" font-family="Arial" font-size="8.00">uses</text>
|
||||
</g>
|
||||
<!-- HotelReservation -->
|
||||
<g id="node13" class="node" pointer-events="visible" data-name="HotelReservation">
|
||||
|
||||
<polygon fill="none" stroke="black" points="618.16,-693.9 618.16,-845.9 787.84,-845.9 787.84,-693.9 618.16,-693.9"/>
|
||||
<text text-anchor="middle" x="703" y="-832.9" font-family="Arial" font-size="10.00">HotelReservation</text>
|
||||
<polyline fill="none" stroke="black" points="618.16,-825.9 787.84,-825.9"/>
|
||||
<text text-anchor="start" x="626.16" y="-812.9" font-family="Arial" font-size="10.00">extends Reservation</text>
|
||||
<text text-anchor="middle" x="703" y="-800.9" font-family="Arial" font-size="10.00">implements IReservation</text>
|
||||
<polyline fill="none" stroke="black" points="618.16,-793.9 787.84,-793.9"/>
|
||||
<text text-anchor="start" x="626.16" y="-780.9" font-family="Arial" font-size="10.00"># type: 'H'</text>
|
||||
<polyline fill="none" stroke="black" points="618.16,-773.9 787.84,-773.9"/>
|
||||
<text text-anchor="start" x="626.16" y="-760.9" font-family="Arial" font-size="10.00">+ HotelReservation(Address)</text>
|
||||
<text text-anchor="start" x="626.16" y="-748.9" font-family="Arial" font-size="10.00">+ ReservationType(): String</text>
|
||||
<text text-anchor="start" x="626.16" y="-736.9" font-family="Arial" font-size="10.00">+ checkValid(): boolean</text>
|
||||
<text text-anchor="start" x="626.16" y="-724.9" font-family="Arial" font-size="10.00">+ getPricePerNight(): float</text>
|
||||
<text text-anchor="start" x="626.16" y="-712.9" font-family="Arial" font-size="10.00">+ calculatePrice(): float</text>
|
||||
<text text-anchor="start" x="626.16" y="-700.9" font-family="Arial" font-size="10.00">+ Reservation(String): Reservation</text>
|
||||
</g>
|
||||
<!-- HotelReservation->Reservation -->
|
||||
<g id="edge3" class="edge" data-name="HotelReservation->Reservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M767.95,-693.99C777.1,-686.23 786.86,-679.11 797,-673.4 873.81,-630.17 913.59,-671.73 990,-627.8 990.75,-627.37 991.49,-626.94 992.23,-626.5"/>
|
||||
<polygon fill="none" stroke="black" points="993.9,-629.59 1000.52,-621.32 990.18,-623.65 993.9,-629.59"/>
|
||||
</g>
|
||||
<!-- HotelReservation->IReservation -->
|
||||
<g id="edge6" class="edge" data-name="HotelReservation->IReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M677.38,-694.2C663.91,-654.95 647.35,-606.67 633.37,-565.92" stroke-dasharray="5,2"/>
|
||||
<polygon fill="none" stroke="black" points="636.73,-564.94 630.18,-556.62 630.11,-567.21 636.73,-564.94"/>
|
||||
</g>
|
||||
<!-- CabinReservation -->
|
||||
<g id="node14" class="node" pointer-events="visible" data-name="CabinReservation">
|
||||
|
||||
<polygon fill="none" stroke="black" points="430.16,-693.9 430.16,-845.9 599.84,-845.9 599.84,-693.9 430.16,-693.9"/>
|
||||
<text text-anchor="middle" x="515" y="-832.9" font-family="Arial" font-size="10.00">CabinReservation</text>
|
||||
<polyline fill="none" stroke="black" points="430.16,-825.9 599.84,-825.9"/>
|
||||
<text text-anchor="start" x="438.16" y="-812.9" font-family="Arial" font-size="10.00">extends Reservation</text>
|
||||
<text text-anchor="middle" x="515" y="-800.9" font-family="Arial" font-size="10.00">implements IReservation</text>
|
||||
<polyline fill="none" stroke="black" points="430.16,-793.9 599.84,-793.9"/>
|
||||
<text text-anchor="start" x="438.16" y="-780.9" font-family="Arial" font-size="10.00"># type: 'C'</text>
|
||||
<polyline fill="none" stroke="black" points="430.16,-773.9 599.84,-773.9"/>
|
||||
<text text-anchor="start" x="438.16" y="-760.9" font-family="Arial" font-size="10.00">+ CabinReservation(Address)</text>
|
||||
<text text-anchor="start" x="438.16" y="-748.9" font-family="Arial" font-size="10.00">+ ReservationType(): String</text>
|
||||
<text text-anchor="start" x="438.16" y="-736.9" font-family="Arial" font-size="10.00">+ checkValid(): boolean</text>
|
||||
<text text-anchor="start" x="438.16" y="-724.9" font-family="Arial" font-size="10.00">+ getPricePerNight(): float</text>
|
||||
<text text-anchor="start" x="438.16" y="-712.9" font-family="Arial" font-size="10.00">+ calculatePrice(): float</text>
|
||||
<text text-anchor="start" x="438.16" y="-700.9" font-family="Arial" font-size="10.00">+ Reservation(String): Reservation</text>
|
||||
</g>
|
||||
<!-- CabinReservation->Reservation -->
|
||||
<g id="edge4" class="edge" data-name="CabinReservation->Reservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M577.98,-694.01C587.62,-685.97 598.04,-678.78 609,-673.4 632.1,-662.06 813.44,-648.86 839,-645.8 906.11,-637.77 929.59,-658.11 990,-627.8 990.62,-627.49 991.23,-627.18 991.85,-626.86"/>
|
||||
<polygon fill="none" stroke="black" points="993.3,-630.05 1000.35,-622.14 989.91,-623.93 993.3,-630.05"/>
|
||||
</g>
|
||||
<!-- CabinReservation->IReservation -->
|
||||
<g id="edge7" class="edge" data-name="CabinReservation->IReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M538.04,-694.2C550.11,-655.04 564.97,-606.88 577.52,-566.18" stroke-dasharray="5,2"/>
|
||||
<polygon fill="none" stroke="black" points="580.86,-567.22 580.46,-556.63 574.17,-565.16 580.86,-567.22"/>
|
||||
</g>
|
||||
<!-- HouseReservation -->
|
||||
<g id="node15" class="node" pointer-events="visible" data-name="HouseReservation">
|
||||
|
||||
<polygon fill="none" stroke="black" points="242.16,-693.9 242.16,-845.9 411.84,-845.9 411.84,-693.9 242.16,-693.9"/>
|
||||
<text text-anchor="middle" x="327" y="-832.9" font-family="Arial" font-size="10.00">HouseReservation</text>
|
||||
<polyline fill="none" stroke="black" points="242.16,-825.9 411.84,-825.9"/>
|
||||
<text text-anchor="start" x="250.16" y="-812.9" font-family="Arial" font-size="10.00">extends Reservation</text>
|
||||
<text text-anchor="middle" x="327" y="-800.9" font-family="Arial" font-size="10.00">implements IReservation</text>
|
||||
<polyline fill="none" stroke="black" points="242.16,-793.9 411.84,-793.9"/>
|
||||
<text text-anchor="start" x="250.16" y="-780.9" font-family="Arial" font-size="10.00"># type: 'Z'</text>
|
||||
<polyline fill="none" stroke="black" points="242.16,-773.9 411.84,-773.9"/>
|
||||
<text text-anchor="start" x="250.16" y="-760.9" font-family="Arial" font-size="10.00">+ HouseReservation(Address)</text>
|
||||
<text text-anchor="start" x="250.16" y="-748.9" font-family="Arial" font-size="10.00">+ ReservationType(): String</text>
|
||||
<text text-anchor="start" x="250.16" y="-736.9" font-family="Arial" font-size="10.00">+ checkValid(): boolean</text>
|
||||
<text text-anchor="start" x="250.16" y="-724.9" font-family="Arial" font-size="10.00">+ getPricePerNight(): float</text>
|
||||
<text text-anchor="start" x="250.16" y="-712.9" font-family="Arial" font-size="10.00">+ calculatePrice(): float</text>
|
||||
<text text-anchor="start" x="250.16" y="-700.9" font-family="Arial" font-size="10.00">+ Reservation(String): Reservation</text>
|
||||
</g>
|
||||
<!-- HouseReservation->Reservation -->
|
||||
<g id="edge5" class="edge" data-name="HouseReservation->Reservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M389.55,-693.91C399.29,-685.84 409.85,-678.66 421,-673.4 546.09,-614.35 593.11,-656.73 731,-645.8 788.51,-641.24 937.81,-652.4 990,-627.8 990.62,-627.51 991.25,-627.21 991.87,-626.91"/>
|
||||
<polygon fill="none" stroke="black" points="993.25,-630.13 1000.46,-622.38 989.99,-623.94 993.25,-630.13"/>
|
||||
</g>
|
||||
<!-- HouseReservation->IReservation -->
|
||||
<g id="edge8" class="edge" data-name="HouseReservation->IReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M398.69,-694.2C437.17,-654.12 484.68,-604.61 524.31,-563.33" stroke-dasharray="5,2"/>
|
||||
<polygon fill="none" stroke="black" points="526.68,-565.92 531.08,-556.28 521.63,-561.07 526.68,-565.92"/>
|
||||
</g>
|
||||
<!-- TestReservations -->
|
||||
<g id="node17" class="node" pointer-events="visible" data-name="TestReservations">
|
||||
|
||||
<polygon fill="none" stroke="black" points="310.73,-960.1 310.73,-1020.1 419.27,-1020.1 419.27,-960.1 310.73,-960.1"/>
|
||||
<text text-anchor="middle" x="365" y="-1007.1" font-family="Arial" font-size="10.00">TestReservations</text>
|
||||
<polyline fill="none" stroke="black" points="310.73,-1000.1 419.27,-1000.1"/>
|
||||
<text text-anchor="middle" x="365" y="-987.1" font-family="Arial" font-size="10.00"> </text>
|
||||
<polyline fill="none" stroke="black" points="310.73,-980.1 419.27,-980.1"/>
|
||||
<text text-anchor="start" x="318.73" y="-967.1" font-family="Arial" font-size="10.00">+ main(String[]): void</text>
|
||||
</g>
|
||||
<!-- TestReservations->AccomodationManager -->
|
||||
<g id="edge17" class="edge" data-name="TestReservations->AccomodationManager">
|
||||
|
||||
<path fill="none" stroke="black" d="M310.79,-969.33C285.47,-958.43 255.93,-943.18 233,-924 215.59,-909.44 199.39,-891.67 185.01,-873.47"/>
|
||||
<polygon fill="black" stroke="black" points="178.95,-865.64 188.63,-870.8 182.01,-869.6 185.07,-873.55 185.07,-873.55 185.07,-873.55 182.01,-869.6 181.51,-876.31 178.95,-865.64 178.95,-865.64"/>
|
||||
<text text-anchor="middle" x="263.45" y="-934.4" font-family="Arial" font-size="8.00">uses</text>
|
||||
</g>
|
||||
<!-- TestReservations->HotelReservation -->
|
||||
<g id="edge18" class="edge" data-name="TestReservations->HotelReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M419,-984.87C484.76,-978.76 590.93,-965.48 622,-941.6 649.93,-920.13 668.69,-886.63 681.04,-854.98"/>
|
||||
<polygon fill="black" stroke="black" points="684.52,-845.67 685.24,-856.61 682.77,-850.35 681.02,-855.04 681.02,-855.04 681.02,-855.04 682.77,-850.35 676.8,-853.46 684.52,-845.67 684.52,-845.67"/>
|
||||
<text text-anchor="middle" x="642.12" y="-934.4" font-family="Arial" font-size="8.00">creates</text>
|
||||
</g>
|
||||
<!-- TestReservations->CabinReservation -->
|
||||
<g id="edge19" class="edge" data-name="TestReservations->CabinReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M391.68,-960.1C401.32,-949.11 412.03,-936.28 421,-924 437.05,-902.01 453.08,-877.22 467.24,-854.09"/>
|
||||
<polygon fill="black" stroke="black" points="472.37,-845.66 471.02,-856.54 469.77,-849.93 467.18,-854.2 467.18,-854.2 467.18,-854.2 469.77,-849.93 463.33,-851.86 472.37,-845.66 472.37,-845.66"/>
|
||||
<text text-anchor="middle" x="426.12" y="-934.4" font-family="Arial" font-size="8.00">creates</text>
|
||||
</g>
|
||||
|
||||
<!-- TestReservations->HouseReservation -->
|
||||
|
||||
<g id="edge20" class="edge" data-name="TestReservations->HouseReservation">
|
||||
|
||||
<path fill="none" stroke="black" d="M354.09,-960.23C352.09,-954.14 350.18,-947.71 348.77,-941.6 342.33,-913.88 337.67,-883.15 334.36,-855.49"/>
|
||||
<polygon fill="black" stroke="black" points="333.24,-845.84 338.86,-855.26 333.81,-850.81 334.39,-855.78 334.39,-855.78 334.39,-855.78 333.81,-850.81 329.92,-856.29 333.24,-845.84 333.24,-845.84"/>
|
||||
<text text-anchor="middle" x="361.12" y="-934.4" font-family="Arial" font-size="8.00">creates</text>
|
||||
</g>
|
||||
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 38 KiB |
0
uml/sequencediagram.dot
Normal file
0
uml/sequencediagram.dot
Normal file
Reference in New Issue
Block a user