public abstract class WatchEvent<T> extends Object
An event or a repeated event for an object that is registered with a WatchService.
<p> An event is classified by its kind and has a count to indicate the number of times that the event has been
observed. This allows for efficient representation of repeated events. The
context method returns any context associated with
the event. In the case of a repeated event then the context is the same for
all events.
<p> Watch events are immutable and safe for use by multiple concurrent threads.
| Modifier and Type | Class and Description |
|---|---|
static interface |
WatchEvent.Kind<T>
An event kind, for the purposes of identification.
|
static interface |
WatchEvent.Modifier
An event modifier that qualifies how a
Watchable is registered
with a WatchService. |
| Modifier | Constructor and Description |
|---|---|
protected |
WatchEvent()
Initializes a new instance of this class.
|
public abstract WatchEvent.Kind<T> kind()
Returns the event kind.
public abstract int count()
Returns the event count. If the event count is greater than 1
then this is a repeated event.
public abstract T context()
Returns the context for the event.
<p> In the case of ENTRY_CREATE,
ENTRY_DELETE, and ENTRY_MODIFY events the context is
a File.
nullCopyright © 2015. All rights reserved.