Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clock-challenge
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AZIAT Mohamed
clock-challenge
Commits
48f85bce
Commit
48f85bce
authored
2 years ago
by
NAVES Guyslain
Browse files
Options
Downloads
Patches
Plain Diff
renommage interface
parent
4e8c53fe
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/ticker/Tickable.java
+1
-1
1 addition, 1 deletion
src/main/java/fr/univamu/ticker/Tickable.java
src/main/java/fr/univamu/ticker/Ticker.java
+3
-5
3 additions, 5 deletions
src/main/java/fr/univamu/ticker/Ticker.java
with
4 additions
and
6 deletions
src/main/java/fr/univamu/ticker/Tick
Listener
.java
→
src/main/java/fr/univamu/ticker/Tick
able
.java
+
1
−
1
View file @
48f85bce
package
fr.univamu.ticker
;
public
interface
Tick
Listener
{
public
interface
Tick
able
{
void
notifyTick
();
}
This diff is collapsed.
Click to expand it.
src/main/java/fr/univamu/ticker/Ticker.java
+
3
−
5
View file @
48f85bce
package
fr.univamu.ticker
;
import
fr.univamu.ticker.TickListener
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Ticker
{
private
Thread
ticking
;
private
final
List
<
Tick
Listener
>
listeners
=
new
ArrayList
<>();
private
final
List
<
Tick
able
>
listeners
=
new
ArrayList
<>();
public
void
add
(
Tick
Listener
listener
)
{
public
void
add
(
Tick
able
listener
)
{
listeners
.
add
(
listener
);
}
...
...
@@ -19,7 +17,7 @@ public class Ticker {
try
{
while
(
true
)
{
Thread
.
sleep
(
1000
);
listeners
.
forEach
(
Tick
Listener
:
:
notifyTick
);
listeners
.
forEach
(
Tick
able
:
:
notifyTick
);
}
}
catch
(
InterruptedException
exc
)
{
// Done
...
...
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