public class NotifyingMonitor extends Monitor implements INotifier
Modifier and Type | Class and Description |
---|---|
static class |
NotifyingMonitor.ProgressEvent |
AbstractMonitor.AsyncTimerTask
OMMonitor.Async
DEFAULT_ASYNC_SCHEDULE_PERIOD
DEFAULT_TIME_FACTOR, THOUSAND
HUNDRED, ONE, TEN, ZERO
Constructor and Description |
---|
NotifyingMonitor() |
NotifyingMonitor(String task) |
NotifyingMonitor(String task,
IListener[] listeners) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IListener listener)
Adds a listener to this notifier.
|
IListener[] |
getListeners()
Returns the listeners that are registered with this notifier.
|
String |
getTask() |
boolean |
hasListeners()
Returns
true if one or more listeners are registered with this notifier, false otherwise. |
void |
removeListener(IListener listener)
Removes a listener from this notifier.
|
void |
worked(double work) |
cancel, cancel, checkCanceled, getAsyncSchedulePeriod, getTimer, isCanceled, scheduleAtFixedRate
begin, begin, createAsyncTimerTask, createNestedMonitor, done, fork, fork, forkAsync, forkAsync, getTotalWork, getWork, getWorkPercent, hasBegun, percent, worked
public NotifyingMonitor()
public NotifyingMonitor(String task)
public String getTask()
public boolean hasListeners()
INotifier
true
if one or more listeners are registered with this notifier, false
otherwise.hasListeners
in interface INotifier
public IListener[] getListeners()
INotifier
Depending on the implementation duplicate listeners may be contained in the returned array.
getListeners
in interface INotifier
public void addListener(IListener listener)
INotifier
Depending on the implementation duplicate listeners may lead to duplicate event delivery or not. Implementors are encouraged to prevent events from being delivered more than once to the same listener,
addListener
in interface INotifier
public void removeListener(IListener listener)
INotifier
removeListener
in interface INotifier
public void worked(double work) throws MonitorCanceledException
worked
in interface OMMonitor
worked
in class AbstractMonitor
MonitorCanceledException
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html