-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient.java
166 lines (146 loc) · 3.2 KB
/
Client.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package com.company;
class Client extends User{
/**
* <p>
* This is a subclass class of user.java and this will be used as a
* simple constructor for the clients/renters of this program
*<br>
* @param -
* @return -
* @see -
* @author
*/
public Client ()
{
}
/**
* <p>
* This is a subclass class of user.java and this will be used as a
* simple constructor for the clients/renters of this program
*<br>
* @param ausername, apassword, aname, aaddress
* @return -
* @see -
* @author
*/
public Client (String ausername, String apassword, String aname, String aaddress)
{
this.username=ausername;
this.password=apassword;
this.role='c';
this.name=aname;
this.address=aaddress;
this.seeUsers=false;
this.seeReserves=false;
this.accepts=false;
this.sendMessages=false;
this.seeHotels=true;
this.seeMessages=true;
this.hasHotel=false;
this.canReserve=true;
}
/**
* <p>
* returns the role as string
*<br>
* @param -
* @return client
* @see -
* @author
*/
public String getRole()
{
return "client";
}
/**
* <p>
* returns the username as string
*<br>
* @param -
* @return this.username
* @see -
* @author
*/
public String getUsername()
{
return this.username;
}
/**
* <p>
* returns the password as string
*<br>
* @param -
* @return this.password
* @see -
* @author
*/
public String getPassword()
{
return this.password;
}
/**
* <p>
* returns the name as string
*<br>
* @param -
* @return this.name
* @see -
* @author
*/
public String getName()
{
return this.name;
}
/**
* <p>
* returns the address as string
*<br>
* @param -
* @return this.address
* @see -
* @author
*/
public String getAddress()
{
return this.address;
}
/**
* <p>
* This is a void function which prints in the
* command line or the ui information for a
* logged client
*<br>
* @param n
* @return null
* @see -
* @author
*/
public Client profile(User n)
{
this.username=n.username;
this.password=n.password;
this.name=n.name;
this.address=n.address;
System.out.println("Name: "+this.name);
System.out.println("Address: " + this.address);
System.out.println("Role: client" );
System.out.println("Username: "+this.username);
System.out.println("Password: " + this.password);
//nope
return null;
}
/**
* <p>
* This is a char function that returns
* the role of every user
*<br>
* @param -
* @return role
* @see -
* @author
*/
public char role()
{
return this.role;
}
}