WatchEvent
public
interface
WatchEvent
java.nio.file.WatchEvent<T> |
An event or a repeated event for an object that is registered with a WatchService
.
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.
Watch events are immutable and safe for use by multiple concurrent threads.
Summary
Nested classes | |
---|---|
interface |
WatchEvent.Kind<T>
An event kind, for the purposes of identification. |
interface |
WatchEvent.Modifier
An event modifier that qualifies how a |
Public methods | |
---|---|
abstract
T
|
context()
Returns the context for the event. |
abstract
int
|
count()
Returns the event count. |
abstract
Kind<T>
|
kind()
Returns the event kind. |
Public methods
context
public abstract T context ()
Returns the context for the event.
In the case of ENTRY_CREATE
,
ENTRY_DELETE
, and ENTRY_MODIFY
events the context is
a Path
that is the relative
path between
the directory registered with the watch service, and the entry that is
created, deleted, or modified.
Returns | |
---|---|
T |
the event context; may be null |
count
public abstract int count ()
Returns the event count. If the event count is greater than 1
then this is a repeated event.
Returns | |
---|---|
int |
the event count |
kind
public abstract Kind<T> kind ()
Returns the event kind.
Returns | |
---|---|
Kind<T> |
the event kind |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
TMZ Celebrity News – Breaking Stories, Videos & Gossip
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
🎥 Watch TMZ Live
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
- Exclusive TMZ interviews and court updates
- Viral celebrity videos and candid photos
- Trending gossip and entertainment news