Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmpt-370-group-project-group26
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eyan Cunningham (esc568)
cmpt-370-group-project-group26
Commits
238e83bb
Commit
238e83bb
authored
2 years ago
by
Rafi Zereselasie (raz070)
Browse files
Options
Downloads
Patches
Plain Diff
There is a new hashmap that contains position data, key = position and the value = wage.
parent
db893721
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SchedulerApp/src/main/java/com/example/schedulerapp/Model.java
+24
-3
24 additions, 3 deletions
...ulerApp/src/main/java/com/example/schedulerapp/Model.java
with
24 additions
and
3 deletions
SchedulerApp/src/main/java/com/example/schedulerapp/Model.java
+
24
−
3
View file @
238e83bb
...
@@ -15,6 +15,7 @@ public class Model {
...
@@ -15,6 +15,7 @@ public class Model {
protected
Map
<
Integer
,
Shift
>
shifts
;
protected
Map
<
Integer
,
Shift
>
shifts
;
protected
Map
<
Integer
,
Employee
>
employees
;
protected
Map
<
Integer
,
Employee
>
employees
;
protected
Map
<
Integer
,
TimeOff
>
timeOff
;
protected
Map
<
Integer
,
TimeOff
>
timeOff
;
protected
Map
<
String
,
Float
>
positions
;
protected
ArrayList
<
ModelSubscriber
>
subscribers
;
protected
ArrayList
<
ModelSubscriber
>
subscribers
;
static
LocalDate
date
;
static
LocalDate
date
;
...
@@ -31,6 +32,7 @@ public class Model {
...
@@ -31,6 +32,7 @@ public class Model {
this
.
shifts
=
new
HashMap
<>();
this
.
shifts
=
new
HashMap
<>();
this
.
employees
=
new
HashMap
<>();
this
.
employees
=
new
HashMap
<>();
this
.
timeOff
=
new
HashMap
<>();
this
.
timeOff
=
new
HashMap
<>();
this
.
positions
=
new
HashMap
<>();
try
{
try
{
InetAddress
ip
=
InetAddress
.
getByName
(
hostname
);
InetAddress
ip
=
InetAddress
.
getByName
(
hostname
);
this
.
socket
=
new
Socket
(
ip
,
port
);
this
.
socket
=
new
Socket
(
ip
,
port
);
...
@@ -156,11 +158,17 @@ public class Model {
...
@@ -156,11 +158,17 @@ public class Model {
return
"No Employees"
;
return
"No Employees"
;
}
}
//This sends " " as the position.
void
addShift
(
int
id
,
String
date
,
int
start
,
int
end
){
void
addShift
(
int
id
,
String
date
,
int
start
,
int
end
){
writer
.
println
(
"addShift/"
+
id
+
"/"
+
date
+
"/"
+
start
+
"/"
+
end
);
writer
.
println
(
"addShift/"
+
id
+
"/"
+
date
+
"/"
+
start
+
"/"
+
end
+
"/"
+
" "
);
notifySubscribers
();
notifySubscribers
();
}
}
//
void
addShift
(
int
id
,
String
date
,
int
start
,
int
end
,
String
position
){
writer
.
println
(
"addShift/"
+
id
+
"/"
+
date
+
"/"
+
start
+
"/"
+
end
+
"/"
+
position
);
notifySubscribers
();
}
void
removeShift
(
int
shiftID
){
void
removeShift
(
int
shiftID
){
writer
.
println
(
"removeShift/"
+
shiftID
);
writer
.
println
(
"removeShift/"
+
shiftID
);
...
@@ -269,12 +277,13 @@ public class Model {
...
@@ -269,12 +277,13 @@ public class Model {
writer
.
println
(
"editShiftAvailability/"
+
shiftID
+
"/"
+
available
);
writer
.
println
(
"editShiftAvailability/"
+
shiftID
+
"/"
+
available
);
}
}
// adds a position if its one of the possible positions in the position table.
void
addEmployeePosition
(
int
employeeID
,
String
position
)
{
void
addEmployeePosition
(
int
employeeID
,
String
position
)
{
writer
.
println
(
"addPosition/"
+
employeeID
+
"/"
+
position
);
writer
.
println
(
"add
Employee
Position/"
+
employeeID
+
"/"
+
position
);
}
}
void
removeEmployeePosition
(
int
employeeID
,
String
position
)
{
void
removeEmployeePosition
(
int
employeeID
,
String
position
)
{
writer
.
println
(
"removePosition/"
+
employeeID
+
"/"
+
position
);
writer
.
println
(
"remove
Employee
Position/"
+
employeeID
+
"/"
+
position
);
}
}
...
@@ -295,6 +304,18 @@ public class Model {
...
@@ -295,6 +304,18 @@ public class Model {
writer
.
println
(
"removeTimeOff/"
+
timeOffID
);
writer
.
println
(
"removeTimeOff/"
+
timeOffID
);
}
}
void
addPosition
(
String
position
,
float
wage
)
{
writer
.
println
(
"addPosition/"
);
}
void
editPositionWage
(
String
position
,
float
wage
)
{
writer
.
println
(
"editPosition/"
);
}
void
removePosition
(
String
position
,
float
wage
)
{
writer
.
println
(
"removePosition/"
);
}
void
logOut
()
{
void
logOut
()
{
writer
.
println
(
"logout"
);
writer
.
println
(
"logout"
);
try
{
try
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment