-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.java
75 lines (64 loc) · 1.29 KB
/
Customer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package Project3_Store;
public class Customer implements Comparable<Customer> {
private int id;
private String firstName;
private String lastName;
private ShoppingCart customerPointer;
public Customer() {
customerPointer = new ShoppingCart();
}
public Customer(int id,String f,String L) {
this.id = id;
this.firstName = f;
this.lastName = L;
customerPointer = new ShoppingCart();
}
public String getFirstName()
{
return firstName;
}
public void setFirstName(String newFirstName)
{
this.firstName = newFirstName;
}
public String getLastName()
{
return firstName;
}
public void setLasttName(String newLastName)
{
this.lastName = newLastName;
}
public double getID()
{
return id;
}
public void setID(int newID)
{
this.id = newID;
}
public ShoppingCart getShopingCart()
{
return customerPointer;
}
public void setShoppingCart(ShoppingCart newCustomerPointer)
{
this.customerPointer = newCustomerPointer;
}
@Override
public String toString()
{
return "First Name: " + firstName + "\nLastName: " + lastName +"\nID: "
+ id + "\nShopping Cart: " + customerPointer.getID() + "\n";
}
@Override
public int compareTo(Customer o) {
// TODO Auto-generated method stub
if(o.getID() == this.getID()) {
return 0;
}
else {
return -1;
}
}
}