Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clock-louati
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOUATI Salma
clock-louati
Commits
97c4aa3f
Commit
97c4aa3f
authored
1 year ago
by
salma-lti
Browse files
Options
Downloads
Patches
Plain Diff
Tâche 8
parent
bf83ae28
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/fr/univamu/l2mi/ticker/PrintAlarm.java
+2
-1
2 additions, 1 deletion
src/main/java/fr/univamu/l2mi/ticker/PrintAlarm.java
src/main/java/fr/univamu/l2mi/ticker/StopClock.java
+20
-0
20 additions, 0 deletions
src/main/java/fr/univamu/l2mi/ticker/StopClock.java
with
22 additions
and
1 deletion
src/main/java/fr/univamu/l2mi/ticker/PrintAlarm.java
+
2
−
1
View file @
97c4aa3f
...
...
@@ -9,6 +9,7 @@ public class PrintAlarm implements Tickable{
int
hours_c
=
0
;
boolean
reached
=
false
;
int
seconds_since
=
0
;
int
max_seconds
=
60
;
public
PrintAlarm
(
int
seconds_c
,
int
minutes
,
int
hours
){
this
.
seconds
=
seconds_c
;
...
...
@@ -38,7 +39,7 @@ public class PrintAlarm implements Tickable{
if
(
reached
){
seconds_since
++;
System
.
out
.
println
(
hours_c
+
":"
+
minutes_c
+
":"
+
seconds_c
);
if
(
seconds_since
==
60
){
if
(
seconds_since
==
max_seconds
){
reached
=
false
;
seconds_since
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/fr/univamu/l2mi/ticker/StopClock.java
0 → 100644
+
20
−
0
View file @
97c4aa3f
package
fr.univamu.l2mi.ticker
;
public
class
StopClock
extends
PrintAlarm
{
int
duration
;
Ticker
ticker
;
public
StopClock
(
int
seconds_c
,
int
minutes
,
int
hours
,
Ticker
ticker
,
int
duration
)
{
super
(
seconds_c
,
minutes
,
hours
);
this
.
duration
=
duration
;
this
.
ticker
=
ticker
;
this
.
max_seconds
=
duration
+
1
;
}
@Override
public
void
notifyTick
()
{
super
.
notifyTick
();
if
(
seconds_since
==
duration
){
ticker
.
stopTicking
();
}
}
}
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