Skip to content

Commit d56051d

Browse files
Felipe Langjavier-godoy
authored andcommitted
docs: improve addCurrentTimeChangeListener method documentation
Close #26
1 parent f57e4d0 commit d56051d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/main/java/com/flowingcode/vaadin/addons/simpletimer/SimpleTimer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,16 @@ public CompletableFuture<BigDecimal> getCurrentTimeAsync() {
159159

160160
/**
161161
* Adds a property change listener for the {@code currentTime} property
162+
*
163+
* @param listener the property change listener
164+
* @param period the minimum period between listener invocations, or 0 to disable throttling
165+
* @param periodUnit time duration of throttling period
162166
*
163-
* @return current value in seconds
167+
* @return this registration, for chaining
164168
*/
165169
public Registration addCurrentTimeChangeListener(
166-
PropertyChangeListener listener, long time, TimeUnit timeUnit) {
167-
int millis = (int) Math.min(timeUnit.toMillis(time), Integer.MAX_VALUE);
170+
PropertyChangeListener listener, long period, TimeUnit periodUnit) {
171+
int millis = (int) Math.min(periodUnit.toMillis(period), Integer.MAX_VALUE);
168172
if (listener == null) {
169173
listener = ev -> {};
170174
}

0 commit comments

Comments
 (0)