- All Known Implementing Classes:
ModificationWatcher
public interface IModificationWatcher
Monitors one or more
IModifiable objects, calling a IChangeListener when a given object's modification time changes.- Author:
- Juergen Donnerstag
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(IModifiable modifiable, IChangeListener<IModifiable> listener) Adds anIModifiableobject and anIChangeListenerobject to call when the modifiable object is modified.voiddestroy()Stops thisModificationWatcher.Retrieves a key set of allIModifiableobjects currently being monitored.remove(IModifiable modifiable) Removes all entries associated with anIModifiableobject.voidStarts watching at a givenDurationpolling rate.
-
Method Details
-
add
Adds anIModifiableobject and anIChangeListenerobject to call when the modifiable object is modified.- Parameters:
modifiable- anIModifiableobject to monitorlistener- anIChangeListenerto call if theIModifiableobject is modified- Returns:
trueif the set did not already contain the specified element
-
remove
Removes all entries associated with anIModifiableobject.- Parameters:
modifiable- anIModifiableobject- Returns:
- the
IModifiableobject that was removed, elsenull
-
start
Starts watching at a givenDurationpolling rate.- Parameters:
pollFrequency- the polling rateDuration
-
destroy
void destroy()Stops thisModificationWatcher. -
getEntries
Retrieves a key set of allIModifiableobjects currently being monitored.- Returns:
- a
Setof allIModifiableentries currently maintained
-