Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Observateur-Observé
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timothee Varin
Observateur-Observé
Commits
64a82c0e
Commit
64a82c0e
authored
1 year ago
by
Fabien Delecroix
Browse files
Options
Downloads
Patches
Plain Diff
typo nommage méthode + mention tests
parent
cf1db811
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
README.md
+6
-4
6 additions, 4 deletions
README.md
src/main/java/fr/univlille/iut/r304/tp4/q1/Subject.java
+1
-1
1 addition, 1 deletion
src/main/java/fr/univlille/iut/r304/tp4/q1/Subject.java
with
7 additions
and
5 deletions
README.md
+
6
−
4
View file @
64a82c0e
...
...
@@ -14,20 +14,22 @@ Il utilise pour ça sa propre méthode « notifyObservers() ».

**Q1.1**
Compléter la classe abstraite Subject de manière à pouvoir disposer du mécanisme Observateur/Observé.
Vérifiez la validité de votre implémentation à l'aide des tests fournis.
```
java
package
fr.univlille.iut.r304.tp4.q1
;
public
abstract
class
Subject
{
public
void
attach
(
Observer
obs
)
public
void
detach
(
Observer
obs
)
public
void
notifyObervers
()
public
void
notifyObervers
(
Object
data
)
public
void
notifyOb
s
ervers
()
public
void
notifyOb
s
ervers
(
Object
data
)
}
```
Nous utiliserons ce pattern pour implémenter un (des) chronomètre(s).
La classe suivante implémente un thread simple qui produit un évènement toutes les secondes.
Ce TimerThread permettra de mettre à jour des horloges qui afficheront l’heure.
On vous fournit la classe suivante (
*TimerThread*
) qui implémente un thread simple qui produit un évènement toutes les secondes.
Ce TimerThread permettra de déclencher la mise à jour des horloges qui afficheront l’heure.
```
java
public
class
TimerThread
extends
Thread
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/fr/univlille/iut/r304/tp4/q1/Subject.java
+
1
−
1
View file @
64a82c0e
...
...
@@ -3,7 +3,7 @@ package fr.univlille.iut.r304.tp4.q1;
public
abstract
class
Subject
{
protected
void
notifyObervers
()
{
protected
void
notifyOb
s
ervers
()
{
}
protected
void
notifyObservers
(
Object
data
)
{
...
...
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