Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ralfkatt/AMD into main
Browse files Browse the repository at this point in the history
  • Loading branch information
majadanielsson committed Nov 23, 2020
2 parents b75cc01 + 4832d31 commit f1f50d0
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
16 changes: 16 additions & 0 deletions Preferences.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import java.util.*;

class Preferences {
// Instance Variables
public Date date;
public int time;
public int duration;
public String commlanguage;

// Constructor Declaration of Class
public Preferences(Date date, int time, int duration, String commlanguage) {
this.date = date;
this.time = time;
this.duration = duration;
this.commlanguage = commlanguage;
}
10 changes: 5 additions & 5 deletions Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ public class Request {
public Date date;
public String location;
public int price;
public Boolean status;
public Preferences RequestPreference = null;
public int status;
public Preferences requestPreference;

// Constructor Declaration of Class
public Request(String typeOfLabour, String desc, Date date, String location, int price, Boolean status) {
public Request(String typeOfLabour, String desc, Date date, String location, int price, int status) {
this.requestId = getRequestId();
this.typeOfLabour = typeOfLabour;
this.desc = desc;
Expand All @@ -32,7 +32,7 @@ public String getOwner() {
return this.requestId;
}

public void setPreferences(String driversLicence, Date date, int time, int duration, String comLanguage) {

public void setPreferences(String driversLicence, Date date, int time, int duration, String commLanguage) {
this.requestPreference = new RequestPreference(date, time, duration, commLanguage, driversLicence);
}
}
12 changes: 12 additions & 0 deletions RequestPreference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.util.*;

class RequestPreference extends Preferences {
// Instance Variables
public String driversLicence;

// Constructor Declaration of Class
public RequestPreference(Date date, int time, int duration, String commLanguage, String driversLicence) {
super(date, time, duration, commLanguage);
this.driversLicence = driversLicence;
}
}
2 changes: 1 addition & 1 deletion Requester.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public Requester(String name, String email, String address, String password) {

// method 1
public Request createRequest(String typeOfLabour, String desc, Date date, String location, int price) {
Request request = new Request(typeOfLabour, desc, date, location, price, false);
Request request = new Request(typeOfLabour, desc, date, location, price, 0);
return request;
}
}
15 changes: 15 additions & 0 deletions ResponderPreference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import java.util.*;

class ResponderPreference extends Preferences {
// Instance Variables
public String location;
public String typeOfLabour;

// Constructor Declaration of Class
public ResponderPreference(Date date, int time, int duration, int commlanguage, String location,
String typeOfLabour) {
super(date, time, duration, commlanguage);
this.location = location;
this.typeOfLabour = typeOfLabour;
}
}

0 comments on commit f1f50d0

Please sign in to comment.